[Python-checkins] bpo-36342: Fix test_multiprocessing in test_venv (GH-12513)

Miss Islington (bot) webhook-mailer at python.org
Thu May 30 17:42:36 EDT 2019


https://github.com/python/cpython/commit/5437ccca1424e415a938c583df43d8cc74047d16
commit: 5437ccca1424e415a938c583df43d8cc74047d16
branch: master
author: xdegaye <xdegaye at gmail.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2019-05-30T14:42:29-07:00
summary:

bpo-36342: Fix test_multiprocessing in test_venv (GH-12513)



when platform lacks a functioning sem_open implementation



https://bugs.python.org/issue36342

files:
A Misc/NEWS.d/next/Tests/2019-03-23-13-58-49.bpo-36342.q6Quiq.rst
M Lib/test/test_venv.py

diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 6822d567e42b..278c68699d8e 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -14,7 +14,8 @@
 import sys
 import tempfile
 from test.support import (captured_stdout, captured_stderr, requires_zlib,
-                          can_symlink, EnvironmentVarGuard, rmtree)
+                          can_symlink, EnvironmentVarGuard, rmtree,
+                          import_module)
 import threading
 import unittest
 import venv
@@ -315,6 +316,10 @@ def test_multiprocessing(self):
         """
         Test that the multiprocessing is able to spawn.
         """
+        # Issue bpo-36342: Instanciation of a Pool object imports the
+        # multiprocessing.synchronize module. Skip the test if this module
+        # cannot be imported.
+        import_module('multiprocessing.synchronize')
         rmtree(self.env_dir)
         self.run_with_capture(venv.create, self.env_dir)
         envpy = os.path.join(os.path.realpath(self.env_dir),
diff --git a/Misc/NEWS.d/next/Tests/2019-03-23-13-58-49.bpo-36342.q6Quiq.rst b/Misc/NEWS.d/next/Tests/2019-03-23-13-58-49.bpo-36342.q6Quiq.rst
new file mode 100644
index 000000000000..a7c92980fd77
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2019-03-23-13-58-49.bpo-36342.q6Quiq.rst
@@ -0,0 +1 @@
+Fix test_multiprocessing in test_venv if platform lacks functioning sem_open.



More information about the Python-checkins mailing list