diff --git a/pkgs/development/python-modules/green/default.nix b/pkgs/development/python-modules/green/default.nix index 0320a3858be1..540d3027b94e 100644 --- a/pkgs/development/python-modules/green/default.nix +++ b/pkgs/development/python-modules/green/default.nix @@ -1,9 +1,11 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k +{ lib +, buildPythonPackage +, isPy3k +, fetchPypi , colorama , coverage -, termstyle -, lxml , unidecode +, lxml }: buildPythonPackage rec { @@ -17,13 +19,22 @@ buildPythonPackage rec { sha256 = "a4d86f2dfa4ccbc86f24bcb9c9ab8bf34219c876c24e9f0603aab4dfe73bb575"; }; + patches = [ + ./tests.patch + ]; + + postPatch = '' + substituteInPlace green/test/test_integration.py \ + --subst-var-by green "$out/bin/green" + ''; + propagatedBuildInputs = [ - colorama coverage termstyle unidecode lxml + colorama coverage unidecode lxml ]; # let green run it's own test suite checkPhase = '' - $out/bin/green green + $out/bin/green -tvvv green ''; meta = with lib; { diff --git a/pkgs/development/python-modules/green/tests.patch b/pkgs/development/python-modules/green/tests.patch new file mode 100644 index 000000000000..7e1c3be62e3f --- /dev/null +++ b/pkgs/development/python-modules/green/tests.patch @@ -0,0 +1,22 @@ +diff --git a/green/test/test_integration.py b/green/test/test_integration.py +index 0cf8cbb..40d9f6b 100644 +--- a/green/test/test_integration.py ++++ b/green/test/test_integration.py +@@ -41,9 +41,7 @@ class TestFinalizer(unittest.TestCase): + ) + fh.close() + args = [ +- sys.executable, +- "-m", +- "green.cmdline", ++ "@green@", + "--finalizer=test_finalizer0.msg", + "--maxtasksperchild=1", + ] +@@ -58,6 +56,5 @@ class TestFinalizer(unittest.TestCase): + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + env=env, +- timeout=10, + ).stdout.decode("utf-8") + self.assertIn("finalizer worked", output)