Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions testing/test_modimport.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,19 @@ def test_fileimport(modfile):
# without needing the pytest namespace being set
# this is critical for the initialization of xdist

res = subprocess.call(
p = subprocess.Popen(
[
sys.executable,
"-c",
"import sys, py; py.path.local(sys.argv[1]).pyimport()",
modfile.strpath,
]
],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
if res:
pytest.fail("command result %s" % res)
(out, err) = p.communicate()
if p.returncode != 0:
pytest.fail(
"importing %s failed (exitcode %d): out=%r, err=%r"
% (modfile, p.returncode, out, err)
)