]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (#150089)
authorPradyun Gedam <pradyunsg@gmail.com>
Thu, 28 May 2026 16:48:51 +0000 (17:48 +0100)
committerGitHub <noreply@github.com>
Thu, 28 May 2026 16:48:51 +0000 (18:48 +0200)
Avoid the runtime environment from affecting the tests' behaviours,
which notably checks the warning filters which can be controlled by
various PYTHON environment variables.

Lib/test/test_regrtest.py

index 207b144d01d92559c58b575e6ee87d88a0942d9a..6d30d267cd5ad29c3e13832412b5026ca8a00d8d 100644 (file)
@@ -2287,7 +2287,8 @@ class ArgsTestCase(BaseTestCase):
         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):