diff options
| author | Victor Stinner <vstinner@python.org> | 2023-08-24 03:35:39 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-24 03:35:39 (GMT) |
| commit | aa9a359ca2663195b0f04eef46109c28c4ff74d3 (patch) | |
| tree | 0e32863755a3aaae775c2680f0e051c037ad21e8 /Lib/test/_test_multiprocessing.py | |
| parent | 174e9da0836844a2138cc8915dd305cb2cd7a583 (diff) | |
| download | cpython-aa9a359ca2663195b0f04eef46109c28c4ff74d3.zip cpython-aa9a359ca2663195b0f04eef46109c28c4ff74d3.tar.gz cpython-aa9a359ca2663195b0f04eef46109c28c4ff74d3.tar.bz2 | |
gh-108388: Split test_multiprocessing_spawn (#108396)
Split test_multiprocessing_fork, test_multiprocessing_forkserver and
test_multiprocessing_spawn into test packages. Each package is made
of 4 sub-tests: processes, threads, manager and misc. It allows
running more tests in parallel and so reduce the total test duration.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
| -rw-r--r-- | Lib/test/_test_multiprocessing.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index a826e31..343e9dc 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -6126,7 +6126,8 @@ class ThreadsMixin(BaseMixin): # Functions used to create test cases from the base ones in this module # -def install_tests_in_module_dict(remote_globs, start_method): +def install_tests_in_module_dict(remote_globs, start_method, + only_type=None, exclude_types=False): __module__ = remote_globs['__name__'] local_globs = globals() ALL_TYPES = {'processes', 'threads', 'manager'} @@ -6139,6 +6140,10 @@ def install_tests_in_module_dict(remote_globs, start_method): continue assert set(base.ALLOWED_TYPES) <= ALL_TYPES, base.ALLOWED_TYPES for type_ in base.ALLOWED_TYPES: + if only_type and type_ != only_type: + continue + if exclude_types: + continue newname = 'With' + type_.capitalize() + name[1:] Mixin = local_globs[type_.capitalize() + 'Mixin'] class Temp(base, Mixin, unittest.TestCase): @@ -6149,6 +6154,9 @@ def install_tests_in_module_dict(remote_globs, start_method): Temp.__module__ = __module__ remote_globs[newname] = Temp elif issubclass(base, unittest.TestCase): + if only_type: + continue + class Temp(base, object): pass Temp.__name__ = Temp.__qualname__ = name |
