From: Pradyun Gedam Date: Thu, 28 May 2026 16:48:51 +0000 (+0100) Subject: gh-150046: Fix `test_add_python_opts` to ignore `PYTHON*` env vars (#150089) X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=ef2246f788832a64ba7c5215c8e72f8e539e59b4;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Lib/test/test_regrtest.py b/Lib/test/test_regrtest.py index 207b144d01d9..6d30d267cd5a 100644 --- a/Lib/test/test_regrtest.py +++ b/Lib/test/test_regrtest.py @@ -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):