diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 02f6e0c74b5ce8..45c05242537632 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -2277,7 +2277,7 @@ def test_python_opts(self): # Use directly subprocess to control the exact command line cmd = [sys.executable, - "-m", "test", option, + "-E", "-m", "test", option, f'--testdir={self.tmptestdir}', testname] proc = subprocess.run(cmd, diff --git a/Misc/NEWS.d/next/Tests/2026-05-19-08-10-20.gh-issue-150046.MndDD8.rst b/Misc/NEWS.d/next/Tests/2026-05-19-08-10-20.gh-issue-150046.MndDD8.rst new file mode 100644 index 00000000000000..b322922e108690 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2026-05-19-08-10-20.gh-issue-150046.MndDD8.rst @@ -0,0 +1 @@ +Avoid ``PYTHON*`` environment variables affecting regrtest's own tests.