Merge pull request #138221 from dotlambda/green-fix

authored by Martin Weinelt and committed by GitHub 27a0b5aa 5a8d17ad

+38 -5
+16 -5
pkgs/development/python-modules/green/default.nix
··· 1 - { lib, buildPythonPackage, fetchPypi, isPy3k 2 , colorama 3 , coverage 4 - , termstyle 5 - , lxml 6 , unidecode 7 }: 8 9 buildPythonPackage rec { ··· 17 sha256 = "a4d86f2dfa4ccbc86f24bcb9c9ab8bf34219c876c24e9f0603aab4dfe73bb575"; 18 }; 19 20 propagatedBuildInputs = [ 21 - colorama coverage termstyle unidecode lxml 22 ]; 23 24 # let green run it's own test suite 25 checkPhase = '' 26 - $out/bin/green green 27 ''; 28 29 meta = with lib; {
··· 1 + { lib 2 + , buildPythonPackage 3 + , isPy3k 4 + , fetchPypi 5 , colorama 6 , coverage 7 , unidecode 8 + , lxml 9 }: 10 11 buildPythonPackage rec { ··· 19 sha256 = "a4d86f2dfa4ccbc86f24bcb9c9ab8bf34219c876c24e9f0603aab4dfe73bb575"; 20 }; 21 22 + patches = [ 23 + ./tests.patch 24 + ]; 25 + 26 + postPatch = '' 27 + substituteInPlace green/test/test_integration.py \ 28 + --subst-var-by green "$out/bin/green" 29 + ''; 30 + 31 propagatedBuildInputs = [ 32 + colorama coverage unidecode lxml 33 ]; 34 35 # let green run it's own test suite 36 checkPhase = '' 37 + $out/bin/green -tvvv green 38 ''; 39 40 meta = with lib; {
+22
pkgs/development/python-modules/green/tests.patch
···
··· 1 + diff --git a/green/test/test_integration.py b/green/test/test_integration.py 2 + index 0cf8cbb..40d9f6b 100644 3 + --- a/green/test/test_integration.py 4 + +++ b/green/test/test_integration.py 5 + @@ -41,9 +41,7 @@ class TestFinalizer(unittest.TestCase): 6 + ) 7 + fh.close() 8 + args = [ 9 + - sys.executable, 10 + - "-m", 11 + - "green.cmdline", 12 + + "@green@", 13 + "--finalizer=test_finalizer0.msg", 14 + "--maxtasksperchild=1", 15 + ] 16 + @@ -58,6 +56,5 @@ class TestFinalizer(unittest.TestCase): 17 + stdout=subprocess.PIPE, 18 + stderr=subprocess.STDOUT, 19 + env=env, 20 + - timeout=10, 21 + ).stdout.decode("utf-8") 22 + self.assertIn("finalizer worked", output)