The maximum number of test processes when using the --parallel option.
()
| 389 | |
| 390 | |
| 391 | def 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 | |
| 406 | def parallel_type(value): |
no outgoing calls