diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-06-13 23:39:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 23:39:56 (GMT) |
commit | c2e51a9985d77e88ea2f4cfe0a53d2befc29541f (patch) | |
tree | 9637558865c14efb39e8b20e6dbb2c501d3419e2 | |
parent | 2b1745f37ca086c24fce7a196dfd3e2d57238cc8 (diff) | |
download | cpython-c2e51a9985d77e88ea2f4cfe0a53d2befc29541f.zip cpython-c2e51a9985d77e88ea2f4cfe0a53d2befc29541f.tar.gz cpython-c2e51a9985d77e88ea2f4cfe0a53d2befc29541f.tar.bz2 |
[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 <steve.dower@python.org>
-rw-r--r-- | Lib/test/test_subprocess.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index 91162da..8e9ad06 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;" |