]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (GH-150089...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 28 May 2026 17:08:53 +0000 (19:08 +0200)
committerGitHub <noreply@github.com>
Thu, 28 May 2026 17:08:53 +0000 (17:08 +0000)
gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (GH-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.
(cherry picked from commit ef2246f788832a64ba7c5215c8e72f8e539e59b4)

Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
Lib/test/test_regrtest.py

index 9206425d997ee5dc8b3734486c880b758b5fb4cb..bb675bfbe335c5907106d593be9837e570cc3f16 100644 (file)
@@ -2275,7 +2275,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):