diff options
| author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-21 19:59:51 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-06-21 19:59:51 (GMT) |
| commit | 11cc475be79c123be0e587b12662cc70b7518348 (patch) | |
| tree | cd52eabbaf20cb4619280283db948e4f7ccf3a6d /Lib/test/test_subprocess.py | |
| parent | 372b838db50540587f643bf553dc070589fe500b (diff) | |
| parent | 372309a5518cf8eedba32e1ee5819fa207b44af4 (diff) | |
| download | cpython-11cc475be79c123be0e587b12662cc70b7518348.zip cpython-11cc475be79c123be0e587b12662cc70b7518348.tar.gz cpython-11cc475be79c123be0e587b12662cc70b7518348.tar.bz2 | |
(merge 3.2) 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.
Diffstat (limited to 'Lib/test/test_subprocess.py')
| -rw-r--r-- | Lib/test/test_subprocess.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/test/test_subprocess.py b/Lib/test/test_subprocess.py index b871359..cded232 100644 --- a/Lib/test/test_subprocess.py +++ b/Lib/test/test_subprocess.py @@ -390,14 +390,17 @@ class ProcessTestCase(BaseTestCase): stdout, stderr = p.communicate() 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): with subprocess.Popen([sys.executable, "-c", 'import os; ' - 'print(len(os.environ))'], + 'print(list(os.environ.keys()))'], stdout=subprocess.PIPE, env={}) as p: stdout, stderr = p.communicate() - self.assertEqual(stdout.strip(), b"0") + self.assertEqual(stdout.strip(), b"[]") def test_communicate_stdin(self): p = subprocess.Popen([sys.executable, "-c", |
