From 4cefe3cf10f498c0927ae4fdba4880d5a64826e4 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 14 Jun 2023 00:00:16 +0100 Subject: gh-105436: Ignore unrelated errors when checking empty env (GH-105742) --- Lib/test/test_subprocess.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 3d4fffb..817eab0 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -1695,9 +1695,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;" -- cgit v0.12