We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents afaad2f + b494d3d commit e00f3a2Copy full SHA for e00f3a2
testing/test_modimport.py
@@ -19,13 +19,19 @@ def test_fileimport(modfile):
19
# without needing the pytest namespace being set
20
# this is critical for the initialization of xdist
21
22
- res = subprocess.call(
+ p = subprocess.Popen(
23
[
24
sys.executable,
25
"-c",
26
"import sys, py; py.path.local(sys.argv[1]).pyimport()",
27
modfile.strpath,
28
- ]
+ ],
29
+ stdout=subprocess.PIPE,
30
+ stderr=subprocess.PIPE,
31
)
- if res:
- pytest.fail("command result %s" % res)
32
+ (out, err) = p.communicate()
33
+ if p.returncode != 0:
34
+ pytest.fail(
35
+ "importing %s failed (exitcode %d): out=%r, err=%r"
36
+ % (modfile, p.returncode, out, err)
37
+ )
0 commit comments