Skip to content

Commit 48c9f55

Browse files
authored
Fix tests: use explicit syspathinsert where tests might hang (#7008)
Use `testdir.syspathinsert()` with multiprocessing tests: - test_chained_exceptions_no_reprcrash - test_exception_handling_no_traceback This only works currently because `_importtestmodule` changes `sys.path` as a side-effect. It appears to be only required on Windows though - likely due to the multiprocessing method used there.
1 parent 5d539af commit 48c9f55

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

testing/test_assertion.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,6 +1264,7 @@ def test_multitask_job():
12641264
multitask_job()
12651265
"""
12661266
)
1267+
testdir.syspathinsert()
12671268
result = testdir.runpytest(p1, "--tb=long")
12681269
result.stdout.fnmatch_lines(
12691270
[

testing/test_reports.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ def test_a():
362362
"""
363363
)
364364

365+
testdir.syspathinsert()
365366
reprec = testdir.inline_run()
366367

367368
reports = reprec.getreports("pytest_runtest_logreport")

0 commit comments

Comments
 (0)