Skip to content

bpo-36342: Fix test_multiprocessing in test_venv #12513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Lib/test/test_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix test_multiprocessing in test_venv if platform lacks functioning sem_open.