diff options
author | Robert Schütz <nix@dotlambda.de> | 2021-09-16 20:42:24 -0700 |
---|---|---|
committer | Robert Schütz <nix@dotlambda.de> | 2021-09-17 09:25:57 -0700 |
commit | 9e474d4f8c7734b8076f332b715272984850df11 (patch) | |
tree | 4a0a329abb3a486166a84f899e0cb1c431931c9d /pkgs/development/python-modules/green | |
parent | a3c4956cf9cb921d61b4a5c30df6ef1c07d2fae4 (diff) | |
download | nixpkgs-9e474d4f8c7734b8076f332b715272984850df11.tar nixpkgs-9e474d4f8c7734b8076f332b715272984850df11.tar.gz nixpkgs-9e474d4f8c7734b8076f332b715272984850df11.tar.bz2 nixpkgs-9e474d4f8c7734b8076f332b715272984850df11.tar.lz nixpkgs-9e474d4f8c7734b8076f332b715272984850df11.tar.xz nixpkgs-9e474d4f8c7734b8076f332b715272984850df11.tar.zst nixpkgs-9e474d4f8c7734b8076f332b715272984850df11.zip |
python3Packages.green: fix tests
Diffstat (limited to 'pkgs/development/python-modules/green')
-rw-r--r-- | pkgs/development/python-modules/green/default.nix | 21 | ||||
-rw-r--r-- | pkgs/development/python-modules/green/tests.patch | 22 |
2 files changed, 38 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/green/default.nix b/pkgs/development/python-modules/green/default.nix index 0320a3858be..540d3027b94 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 00000000000..7e1c3be62e3 --- /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) |