mirror of
https://github.com/django/django.git
synced 2025-07-24 05:36:15 +00:00
Fixed #31621 -- Added support for '--parallel auto' to test management command.
This commit is contained in:
parent
7e38a8d66f
commit
ae89daf46f
5 changed files with 67 additions and 22 deletions
|
@ -1467,10 +1467,12 @@ Enables :ref:`SQL logging <django-db-logger>` for failing tests. If
|
|||
Runs tests in separate parallel processes. Since modern processors have
|
||||
multiple cores, this allows running tests significantly faster.
|
||||
|
||||
By default ``--parallel`` runs one process per core according to
|
||||
:func:`multiprocessing.cpu_count()`. You can adjust the number of processes
|
||||
either by providing it as the option's value, e.g. ``--parallel=4``, or by
|
||||
setting the :envvar:`DJANGO_TEST_PROCESSES` environment variable.
|
||||
Using ``--parallel`` without a value, or with the value ``auto``, runs one test
|
||||
process per core according to :func:`multiprocessing.cpu_count()`. You can
|
||||
override this by passing the desired number of processes, e.g.
|
||||
``--parallel 4``. You can also enable ``--parallel`` without passing the flag
|
||||
by setting the :envvar:`DJANGO_TEST_PROCESSES` environment variable to the
|
||||
desired number of processes.
|
||||
|
||||
Django distributes test cases — :class:`unittest.TestCase` subclasses — to
|
||||
subprocesses. If there are fewer test cases than configured processes, Django
|
||||
|
@ -1511,6 +1513,10 @@ don't.
|
|||
in order to exchange them between processes. See
|
||||
:ref:`python:pickle-picklable` for details.
|
||||
|
||||
.. versionchanged:: 4.0
|
||||
|
||||
Support for the value ``auto`` was added.
|
||||
|
||||
.. option:: --tag TAGS
|
||||
|
||||
Runs only tests :ref:`marked with the specified tags <topics-tagging-tests>`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue