From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 13 Jun 2023 23:39:56 +0000 (-0700) Subject: [3.11] gh-105436: Ignore unrelated errors when checking empty env (GH-105742) (#105757) X-Git-Tag: v3.11.5~278 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c2e51a9985d77e88ea2f4cfe0a53d2befc29541f;p=thirdparty%2FPython%2Fcpython.git [3.11] gh-105436: Ignore unrelated errors when checking empty env (GH-105742) (#105757) gh-105436: Ignore unrelated errors when checking empty env (GH-105742) (cherry picked from commit 4cefe3cf10f498c0927ae4fdba4880d5a64826e4) Co-authored-by: Steve Dower --- diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 91162da4f776..8e9ad06c6eb8 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1693,9 +1693,10 @@ class RunFuncTestCase(BaseTestCase): @unittest.skipUnless(mswindows, "Maybe test trigger a leak on Ubuntu") def test_run_with_an_empty_env(self): # gh-105436: fix subprocess.run(..., env={}) broken on Windows - args = [sys.executable, "-c", 'import sys; sys.exit(57)'] - res = subprocess.run(args, env={}) - self.assertEqual(res.returncode, 57) + args = [sys.executable, "-c", 'pass'] + # Ignore subprocess errors - we only care that the API doesn't + # raise an OSError + subprocess.run(args, env={}) def test_capture_output(self): cp = self.run_python(("import sys;"