MCPcopy
hub / github.com/django/django / get_max_test_processes

Function get_max_test_processes

django/test/runner.py:391–403  ·  view source on GitHub ↗

The maximum number of test processes when using the --parallel option.

()

Source from the content-addressed store, hash-verified

389
390
391def get_max_test_processes():
392 """
393 The maximum number of test processes when using the --parallel option.
394 """
395 # The current implementation of the parallel test runner requires
396 # multiprocessing to start subprocesses with fork(), forkserver(), or
397 # spawn().
398 if multiprocessing.get_start_method() not in {"fork", "spawn", "forkserver"}:
399 return 1
400 try:
401 return int(os.environ["DJANGO_TEST_PROCESSES"])
402 except KeyError:
403 return multiprocessing.cpu_count()
404
405
406def parallel_type(value):

Calls

no outgoing calls