python3Packages.green: fix tests

This commit is contained in:
Robert Schütz 2021-09-16 20:42:24 -07:00
parent a3c4956cf9
commit 9e474d4f8c
2 changed files with 38 additions and 5 deletions

View File

@ -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; {

View File

@ -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)