mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-71052: Enable test_concurrent_futures on platforms that lack multiprocessing (gh-115917)
Enable test_concurrent_futures on platforms that support threading but not multiprocessing.
This commit is contained in:
parent
c40b5b97fd
commit
4827968af8
6 changed files with 16 additions and 21 deletions
|
@ -3,8 +3,6 @@ import unittest
|
|||
from test import support
|
||||
from test.support import import_helper
|
||||
|
||||
# Skip tests if _multiprocessing wasn't built.
|
||||
import_helper.import_module('_multiprocessing')
|
||||
|
||||
if support.check_sanitizer(address=True, memory=True):
|
||||
# gh-90791: Skip the test because it is too slow when Python is built
|
||||
|
|
|
@ -5,6 +5,8 @@ import time
|
|||
import unittest
|
||||
import sys
|
||||
from concurrent.futures._base import BrokenExecutor
|
||||
from concurrent.futures.process import _check_system_limits
|
||||
|
||||
from logging.handlers import QueueHandler
|
||||
|
||||
from test import support
|
||||
|
@ -117,6 +119,11 @@ class FailingInitializerResourcesTest(unittest.TestCase):
|
|||
"""
|
||||
|
||||
def _test(self, test_class):
|
||||
try:
|
||||
_check_system_limits()
|
||||
except NotImplementedError:
|
||||
self.skipTest("ProcessPoolExecutor unavailable on this system")
|
||||
|
||||
runner = unittest.TextTestRunner()
|
||||
runner.run(test_class('test_initializer'))
|
||||
|
||||
|
|
|
@ -136,6 +136,12 @@ def create_executor_tests(remote_globals, mixin, bases=(BaseTestCase,),
|
|||
|
||||
|
||||
def setup_module():
|
||||
unittest.addModuleCleanup(multiprocessing.util._cleanup_tests)
|
||||
try:
|
||||
_check_system_limits()
|
||||
except NotImplementedError:
|
||||
pass
|
||||
else:
|
||||
unittest.addModuleCleanup(multiprocessing.util._cleanup_tests)
|
||||
|
||||
thread_info = threading_helper.threading_setup()
|
||||
unittest.addModuleCleanup(threading_helper.threading_cleanup, *thread_info)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue