diff --git a/pkgs/development/python-modules/androguard/default.nix b/pkgs/development/python-modules/androguard/default.nix index b952e71ac7c6..c5a4300736ee 100644 --- a/pkgs/development/python-modules/androguard/default.nix +++ b/pkgs/development/python-modules/androguard/default.nix @@ -15,8 +15,7 @@ ipython, pyqt5, pyperclip, - nose, - nose-timer, + pytestCheckHook, mock, python-magic, codecov, @@ -25,11 +24,12 @@ # This is usually used as a library, and it'd be a shame to force the GUI # libraries to the closure if GUI is not desired. withGui ? false, - # Tests take a very long time, and currently fail, but next release' tests - # shouldn't fail - doCheck ? false, + # Deprecated in 24.11. + doCheck ? true, }: +assert lib.warnIf (!doCheck) "python3Packages.androguard: doCheck is deprecated" true; + buildPythonPackage rec { pname = "androguard"; version = "3.4.0a1"; @@ -42,7 +42,10 @@ buildPythonPackage rec { sha256 = "1aparxiq11y0hbvkayp92w684nyxyyx7mi0n1x6x51g5z6c58vmy"; }; - patches = [ ./drop-removed-networkx-formats.patch ]; + patches = [ + ./drop-removed-networkx-formats.patch + ./fix-tests.patch + ]; build-system = [ setuptools ]; @@ -69,23 +72,17 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ + pytestCheckHook codecov coverage mock - nose - nose-timer pyperclip pyqt5 python-magic ]; - inherit doCheck; # If it won't be verbose, you'll see nothing going on for a long time. - checkPhase = '' - runHook preCheck - nosetests --verbosity=3 - runHook postCheck - ''; + pytestFlagsArray = [ "--verbose" ]; preFixup = lib.optionalString withGui '' makeWrapperArgs+=("''${qtWrapperArgs[@]}") diff --git a/pkgs/development/python-modules/androguard/fix-tests.patch b/pkgs/development/python-modules/androguard/fix-tests.patch new file mode 100644 index 000000000000..b971b46c6244 --- /dev/null +++ b/pkgs/development/python-modules/androguard/fix-tests.patch @@ -0,0 +1,13 @@ +diff --git a/tests/test_types.py b/tests/test_types.py +index 127dfc20eb..f1c89f0712 100644 +--- a/tests/test_types.py ++++ b/tests/test_types.py +@@ -182,7 +182,7 @@ + for i in filter(lambda x: 'const' in x.get_name(), method.get_instructions()): + i.show(0) + # ins should only have one literal +- self.assertEquals(len(i.get_literals()), 1) ++ self.assertEqual(len(i.get_literals()), 1) + + fmt, value = VALUES[method.full_name].pop(0) + converted = format_value(i.get_literals()[0], i, fmt)