mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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.
This commit is contained in:
parent
2c2a4f3d85
commit
ddbeb2f3e0
9 changed files with 48 additions and 12 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue