summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_venv.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-06-18 16:56:43 (GMT)
committerGitHub <noreply@github.com>2020-06-18 16:56:43 (GMT)
commite8056180a13b6755e4e3e5505b7bf03f79da29fb (patch)
tree3b7ee3611f140572e4baefb9aab46a5b0fa4653e /Lib/test/test_venv.py
parent3d974b2fc681ddd0ec722cf631008d5941da52b8 (diff)
downloadcpython-e8056180a13b6755e4e3e5505b7bf03f79da29fb.zip
cpython-e8056180a13b6755e4e3e5505b7bf03f79da29fb.tar.gz
cpython-e8056180a13b6755e4e3e5505b7bf03f79da29fb.tar.bz2
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944) (GH-20962) (GH-20966)
On Linux, skip tests using multiprocessing if the current user cannot create a file in /dev/shm/ directory. Add the skip_if_broken_multiprocessing_synchronize() function to the test.support module. (cherry picked from commit ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881) (cherry picked from commit b1e736113484c99acb57e4acb417b91a9e58e7ff)
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r--Lib/test/test_venv.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py
index 7e05138..28743f0 100644
--- a/Lib/test/test_venv.py
+++ b/Lib/test/test_venv.py
@@ -16,7 +16,8 @@ import sys
import tempfile
from test.support import (captured_stdout, captured_stderr, requires_zlib,
can_symlink, EnvironmentVarGuard, rmtree,
- import_module)
+ import_module,
+ skip_if_broken_multiprocessing_synchronize)
import threading
import unittest
import venv
@@ -324,10 +325,11 @@ class BasicTest(BaseTest):
"""
Test that the multiprocessing is able to spawn.
"""
- # Issue bpo-36342: Instanciation of a Pool object imports the
+ # bpo-36342: Instantiation of a Pool object imports the
# multiprocessing.synchronize module. Skip the test if this module
# cannot be imported.
- import_module('multiprocessing.synchronize')
+ skip_if_broken_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),