diff options
author | Victor Stinner <vstinner@python.org> | 2020-06-18 12:53:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 12:53:19 (GMT) |
commit | ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881 (patch) | |
tree | 5d992ac64b1be1b2329c398fc82323b2e433a344 /Lib/test/test_venv.py | |
parent | 2c2a4f3d8545784c6e4ca8128bfc706916080712 (diff) | |
download | cpython-ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881.zip cpython-ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881.tar.gz cpython-ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881.tar.bz2 |
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)
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.
Diffstat (limited to 'Lib/test/test_venv.py')
-rw-r--r-- | Lib/test/test_venv.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_venv.py b/Lib/test/test_venv.py index ef6d7bd..d3191ed 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 unittest import venv from unittest.mock import patch @@ -357,10 +358,11 @@ class BasicTest(BaseTest): """ Test that the multiprocessing is able to spawn. """ - # Issue bpo-36342: Instantiation 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), |