diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-08-04 09:16:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-04 09:16:38 +0200 |
| commit | d4db417c8e6935222d198925dd4c5ac1ca737909 (patch) | |
| tree | 38717c9a3c1c494cf7f3b717670e0da4dd3fdd82 | |
| parent | 0638b4e23dbabdcf7d7a6f2a2d5b95b980dece78 (diff) | |
Fixed #33891 -- Fixed test command crash when running in parallel using spawn.
Thanks Kevin Renskers for the report.
Regression in 41c4cb253c137edf5a96b7408ea55d57d6e0602a.
| -rw-r--r-- | django/test/runner.py | 14 | ||||
| -rw-r--r-- | docs/releases/4.1.1.txt | 4 |
2 files changed, 10 insertions, 8 deletions
diff --git a/django/test/runner.py b/django/test/runner.py index 270ddf5b59..24ce766ce1 100644 --- a/django/test/runner.py +++ b/django/test/runner.py @@ -443,6 +443,11 @@ def _run_subsuite(args): return subsuite_index, result.events +def _process_setup_stub(*args): + """Stub method to simplify run() implementation.""" + pass + + class ParallelTestSuite(unittest.TestSuite): """ Run a series of tests in parallel in several processes. @@ -461,6 +466,7 @@ class ParallelTestSuite(unittest.TestSuite): # In case someone wants to modify these in a subclass. init_worker = _init_worker + process_setup = _process_setup_stub process_setup_args = () run_subsuite = _run_subsuite runner_class = RemoteTestRunner @@ -474,14 +480,6 @@ class ParallelTestSuite(unittest.TestSuite): self.serialized_contents = None super().__init__() - def process_setup(self, *args): - """ - Stub method to simplify run() implementation. "self" is never actually - passed because a function implementing this method (__func__) is - always used, not the method itself. - """ - pass - def run(self, result): """ Distribute test cases across workers. diff --git a/docs/releases/4.1.1.txt b/docs/releases/4.1.1.txt index 2d705f6a99..ec1b61617d 100644 --- a/docs/releases/4.1.1.txt +++ b/docs/releases/4.1.1.txt @@ -14,3 +14,7 @@ Bugfixes * Fixed a regression in Django 4.1 that caused a crash of admin's autocomplete widgets when translations are deactivated (:ticket:`33888`). + +* Fixed a regression in Django 4.1 that caused a crash of the ``test`` + management command when running in parallel and ``multiprocessing`` start + method is ``spawn`` (:ticket:`33891`). |
