cpython: f7ddd72b70ea (original) (raw)

--- a/Lib/test/libregrtest/runtest.py +++ b/Lib/test/libregrtest/runtest.py @@ -116,7 +116,7 @@ def runtest(ns, test): try: sys.stdout = stream sys.stderr = stream

@@ -127,7 +127,7 @@ def runtest(ns, test): sys.stderr = orig_stderr else: support.verbose = verbose # Tell tests to be moderately quiet

--- a/Lib/test/libregrtest/setup.py +++ b/Lib/test/libregrtest/setup.py @@ -29,6 +29,11 @@ def setup_tests(ns): replace_stdout() support.record_original_stdout(sys.stdout)

+ # Some times path and file are not absolute (e.g. while running from # Lib/) and, if we change the CWD to run the tests in a temporary dir, some # imports might fail. This affects only the modules imported before os.chdir().

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -879,6 +879,9 @@ Documentation Tests ----- +- Issue #26295: When using "python3 -m test --testdir=TESTDIR", regrtest