mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
bpo-40280: Address more test failures on Emscripten (GH-31050)
Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
9d4161a60c
commit
96b344c2f1
27 changed files with 227 additions and 49 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue