Skip to content

Commit 00cd29b

Browse files
authored
unittest/discover: Reverse order of parent/top in sys.path.
When running tests from subfolders, insert top as higher priority entry in sys.path. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
1 parent 50ed36f commit 00cd29b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python-stdlib/unittest-discover/unittest/__main__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def _run_test_module(runner: TestRunner, module_name: str, *extra_paths: list[st
1414
module_snapshot = {k: v for k, v in sys.modules.items()}
1515
path_snapshot = sys.path[:]
1616
try:
17-
for path in reversed(extra_paths):
17+
for path in extra_paths:
1818
if path:
1919
sys.path.insert(0, path)
2020

0 commit comments

Comments
 (0)