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

when platform lacks a functioning sem_open implementation



https://bugs.python.org/issue36342
This commit is contained in:
xdegaye 2019-05-30 23:42:29 +02:00 committed by Miss Islington (bot)
parent 2f5b9dcc0a
commit 5437ccca14
2 changed files with 7 additions and 1 deletions

View File

@ -14,7 +14,8 @@ import subprocess
import sys import sys
import tempfile import tempfile
from test.support import (captured_stdout, captured_stderr, requires_zlib, from test.support import (captured_stdout, captured_stderr, requires_zlib,
can_symlink, EnvironmentVarGuard, rmtree) can_symlink, EnvironmentVarGuard, rmtree,
import_module)
import threading import threading
import unittest import unittest
import venv import venv
@ -315,6 +316,10 @@ class BasicTest(BaseTest):
""" """
Test that the multiprocessing is able to spawn. 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) rmtree(self.env_dir)
self.run_with_capture(venv.create, self.env_dir) self.run_with_capture(venv.create, self.env_dir)
envpy = os.path.join(os.path.realpath(self.env_dir), envpy = os.path.join(os.path.realpath(self.env_dir),

View File

@ -0,0 +1 @@
Fix test_multiprocessing in test_venv if platform lacks functioning sem_open.