mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #12383: skip test_empty_env() if compiled is compiled in shared mode
Try also to get more informations about the Mac OS X failure: display the keys of the environment, instead of just the number of variables.
This commit is contained in:
parent
f1512a2967
commit
372309a551
1 changed files with 5 additions and 2 deletions
|
@ -339,14 +339,17 @@ class ProcessTestCase(BaseTestCase):
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
self.assertEqual(stdout, b"orange")
|
self.assertEqual(stdout, b"orange")
|
||||||
|
|
||||||
|
@unittest.skipIf(sysconfig.get_config_var('Py_ENABLE_SHARED') == 1,
|
||||||
|
'the python library cannot be loaded '
|
||||||
|
'with an empty environment')
|
||||||
def test_empty_env(self):
|
def test_empty_env(self):
|
||||||
with subprocess.Popen([sys.executable, "-c",
|
with subprocess.Popen([sys.executable, "-c",
|
||||||
'import os; '
|
'import os; '
|
||||||
'print(len(os.environ))'],
|
'print(list(os.environ.keys()))'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
env={}) as p:
|
env={}) as p:
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
self.assertEqual(stdout.strip(), b"0")
|
self.assertEqual(stdout.strip(), b"[]")
|
||||||
|
|
||||||
def test_communicate_stdin(self):
|
def test_communicate_stdin(self):
|
||||||
p = subprocess.Popen([sys.executable, "-c",
|
p = subprocess.Popen([sys.executable, "-c",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue