Merge pull request #138221 from dotlambda/green-fix

This commit is contained in:
Martin Weinelt 2021-09-17 19:54:45 +02:00 committed by GitHub
commit 27a0b5aa3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)