Commits

Victor Stinner committed d1d5a73 Merge

(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.

Comments (0)

Files changed (1)

Lib/test/test_subprocess.py

             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",
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.