diff options
author | Christian Heimes <christian@python.org> | 2020-06-04 12:48:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 12:48:17 (GMT) |
commit | b022e5cffbd3ff51ae361cf80f2a3b660be8b1ee (patch) | |
tree | 51ffe1871cb328287dc08b71d28f5393a9585638 /Lib/test/_test_multiprocessing.py | |
parent | 50a48dad5579d67d7cae350f6ad5ae5c33f56abb (diff) | |
download | cpython-b022e5cffbd3ff51ae361cf80f2a3b660be8b1ee.zip cpython-b022e5cffbd3ff51ae361cf80f2a3b660be8b1ee.tar.gz cpython-b022e5cffbd3ff51ae361cf80f2a3b660be8b1ee.tar.bz2 |
bpo-17258: Add requires_hashdigest to multiprocessing tests (GH-20412)
Skip some :mod:`multiprocessing` tests when MD5 hash digest is blocked.
Signed-off-by: Christian Heimes <christian@python.org>
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r-- | Lib/test/_test_multiprocessing.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index bbba2b4..d01a668 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -26,6 +26,7 @@ import warnings import test.support import test.support.script_helper from test import support +from test.support import hashlib_helper from test.support import socket_helper from test.support import threading_helper @@ -2954,6 +2955,8 @@ class _TestRemoteManager(BaseTestCase): # Make queue finalizer run before the server is stopped del queue + +@hashlib_helper.requires_hashdigest('md5') class _TestManagerRestart(BaseTestCase): @classmethod @@ -3438,6 +3441,7 @@ class _TestPoll(BaseTestCase): # @unittest.skipUnless(HAS_REDUCTION, "test needs multiprocessing.reduction") +@hashlib_helper.requires_hashdigest('md5') class _TestPicklingConnections(BaseTestCase): ALLOWED_TYPES = ('processes',) @@ -3740,6 +3744,7 @@ class _TestSharedCTypes(BaseTestCase): @unittest.skipUnless(HAS_SHMEM, "requires multiprocessing.shared_memory") +@hashlib_helper.requires_hashdigest('md5') class _TestSharedMemory(BaseTestCase): ALLOWED_TYPES = ('processes',) @@ -4415,6 +4420,7 @@ class TestInvalidHandle(unittest.TestCase): +@hashlib_helper.requires_hashdigest('md5') class OtherTest(unittest.TestCase): # TODO: add more tests for deliver/answer challenge. def test_deliver_challenge_auth_failure(self): @@ -4451,6 +4457,7 @@ class OtherTest(unittest.TestCase): def initializer(ns): ns.test += 1 +@hashlib_helper.requires_hashdigest('md5') class TestInitializers(unittest.TestCase): def setUp(self): self.mgr = multiprocessing.Manager() @@ -5305,6 +5312,7 @@ class TestPoolNotLeakOnFailure(unittest.TestCase): any(process.is_alive() for process in forked_processes)) +@hashlib_helper.requires_hashdigest('md5') class TestSyncManagerTypes(unittest.TestCase): """Test all the types which can be shared between a parent and a child process by using a manager which acts as an intermediary @@ -5699,6 +5707,8 @@ def install_tests_in_module_dict(remote_globs, start_method): Mixin = local_globs[type_.capitalize() + 'Mixin'] class Temp(base, Mixin, unittest.TestCase): pass + if type_ == 'manager': + Temp = hashlib_helper.requires_hashdigest('md5')(Temp) Temp.__name__ = Temp.__qualname__ = newname Temp.__module__ = __module__ remote_globs[newname] = Temp |