Skip to content

Commit

Permalink
[3.12] gh-105436: Ignore unrelated errors when checking empty env (GH…
Browse files Browse the repository at this point in the history
…-105742) (#105756)

gh-105436: Ignore unrelated errors when checking empty env (GH-105742)
(cherry picked from commit 4cefe3c)

Co-authored-by: Steve Dower <[email protected]>
  • Loading branch information
miss-islington and zooba authored Jun 13, 2023
1 parent 51b533e commit 75239d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1695,9 +1695,10 @@ def test_run_with_pathlike_path_and_arguments(self):
@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;"
Expand Down

0 comments on commit 75239d5

Please sign in to comment.