mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
gh-105436: Ignore unrelated errors when checking empty env (GH-105742)
This commit is contained in:
parent
457a459c78
commit
4cefe3cf10
1 changed files with 4 additions and 3 deletions
|
@ -1695,9 +1695,10 @@ class RunFuncTestCase(BaseTestCase):
|
||||||
@unittest.skipUnless(mswindows, "Maybe test trigger a leak on Ubuntu")
|
@unittest.skipUnless(mswindows, "Maybe test trigger a leak on Ubuntu")
|
||||||
def test_run_with_an_empty_env(self):
|
def test_run_with_an_empty_env(self):
|
||||||
# gh-105436: fix subprocess.run(..., env={}) broken on Windows
|
# gh-105436: fix subprocess.run(..., env={}) broken on Windows
|
||||||
args = [sys.executable, "-c", 'import sys; sys.exit(57)']
|
args = [sys.executable, "-c", 'pass']
|
||||||
res = subprocess.run(args, env={})
|
# Ignore subprocess errors - we only care that the API doesn't
|
||||||
self.assertEqual(res.returncode, 57)
|
# raise an OSError
|
||||||
|
subprocess.run(args, env={})
|
||||||
|
|
||||||
def test_capture_output(self):
|
def test_capture_output(self):
|
||||||
cp = self.run_python(("import sys;"
|
cp = self.run_python(("import sys;"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue