https://github.com/python/cpython/commit/ef2246f788832a64ba7c5215c8e72f8e539e59b4
commit: ef2246f788832a64ba7c5215c8e72f8e539e59b4
branch: main
author: Pradyun Gedam <[email protected]>
committer: vstinner <[email protected]>
date: 2026-05-28T18:48:51+02:00
summary:

gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (#150089)

Avoid the runtime environment from affecting the tests' behaviours,
which notably checks the warning filters which can be controlled by
various PYTHON environment variables.

files:
M Lib/test/test_regrtest.py

diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py
index 207b144d01d925..6d30d267cd5ad2 100644
--- a/Lib/test/test_regrtest.py
+++ b/Lib/test/test_regrtest.py
@@ -2287,7 +2287,8 @@ def test_python_opts(self):
         proc = subprocess.run(cmd,
                               stdout=subprocess.PIPE,
                               stderr=subprocess.STDOUT,
-                              text=True)
+                              text=True,
+                              env=support.make_clean_env())
         self.assertEqual(proc.returncode, 0, proc)
 
     def test_add_python_opts(self):

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to