Skip to content

Commit 5437ccc

Browse files
xdegayemiss-islington
authored andcommitted
bpo-36342: Fix test_multiprocessing in test_venv (GH-12513)
when platform lacks a functioning sem_open implementation https://bugs.python.org/issue36342
1 parent 2f5b9dc commit 5437ccc

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Lib/test/test_venv.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import sys
1515
import tempfile
1616
from test.support import (captured_stdout, captured_stderr, requires_zlib,
17-
can_symlink, EnvironmentVarGuard, rmtree)
17+
can_symlink, EnvironmentVarGuard, rmtree,
18+
import_module)
1819
import threading
1920
import unittest
2021
import venv
@@ -315,6 +316,10 @@ def test_multiprocessing(self):
315316
"""
316317
Test that the multiprocessing is able to spawn.
317318
"""
319+
# Issue bpo-36342: Instanciation of a Pool object imports the
320+
# multiprocessing.synchronize module. Skip the test if this module
321+
# cannot be imported.
322+
import_module('multiprocessing.synchronize')
318323
rmtree(self.env_dir)
319324
self.run_with_capture(venv.create, self.env_dir)
320325
envpy = os.path.join(os.path.realpath(self.env_dir),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix test_multiprocessing in test_venv if platform lacks functioning sem_open.

0 commit comments

Comments
 (0)