bpo-40280: Address more test failures on Emscripten (GH-31050)

Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
Christian Heimes 2022-02-05 21:52:01 +02:00 committed by GitHub
parent 9d4161a60c
commit 96b344c2f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 227 additions and 49 deletions

View file

@ -992,6 +992,7 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
@unittest.skipUnless(unix_shell and os.path.exists(unix_shell),
'requires a shell')
@unittest.skipUnless(hasattr(os, 'popen'), "needs os.popen()")
@support.requires_subprocess()
def test_update2(self):
os.environ.clear()
os.environ.update(HELLO="World")
@ -1002,6 +1003,7 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
@unittest.skipUnless(unix_shell and os.path.exists(unix_shell),
'requires a shell')
@unittest.skipUnless(hasattr(os, 'popen'), "needs os.popen()")
@support.requires_subprocess()
def test_os_popen_iter(self):
with os.popen("%s -c 'echo \"line1\nline2\nline3\"'"
% unix_shell) as popen:
@ -1173,6 +1175,8 @@ class EnvironTests(mapping_tests.BasicTestMappingProtocol):
def _test_underlying_process_env(self, var, expected):
if not (unix_shell and os.path.exists(unix_shell)):
return
elif not support.has_subprocess_support:
return
with os.popen(f"{unix_shell} -c 'echo ${var}'") as popen:
value = popen.read().strip()