Loading django/test/runner.py +5 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,11 @@ def default_test_processes(): """ Default number of test processes when using the --parallel option. """ # The current implementation of the parallel test runner requires # multiprocessing to start subprocesses with fork(). # On Python 3.4+: if multiprocessing.get_start_method() != 'fork': if not hasattr(os, 'fork'): return 1 try: return int(os.environ['DJANGO_TEST_PROCESSES']) except KeyError: Loading tests/runtests.py +1 −4 Original line number Diff line number Diff line Loading @@ -236,11 +236,8 @@ def teardown(state): def actual_test_processes(parallel): if parallel == 0: # On Python 3.4+: if multiprocessing.get_start_method() != 'fork': if not hasattr(os, 'fork'): return 1 # This doesn't work before django.setup() on some databases. elif all(conn.features.can_clone_databases for conn in connections.all()): if all(conn.features.can_clone_databases for conn in connections.all()): return default_test_processes() else: return 1 Loading Loading
django/test/runner.py +5 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,11 @@ def default_test_processes(): """ Default number of test processes when using the --parallel option. """ # The current implementation of the parallel test runner requires # multiprocessing to start subprocesses with fork(). # On Python 3.4+: if multiprocessing.get_start_method() != 'fork': if not hasattr(os, 'fork'): return 1 try: return int(os.environ['DJANGO_TEST_PROCESSES']) except KeyError: Loading
tests/runtests.py +1 −4 Original line number Diff line number Diff line Loading @@ -236,11 +236,8 @@ def teardown(state): def actual_test_processes(parallel): if parallel == 0: # On Python 3.4+: if multiprocessing.get_start_method() != 'fork': if not hasattr(os, 'fork'): return 1 # This doesn't work before django.setup() on some databases. elif all(conn.features.can_clone_databases for conn in connections.all()): if all(conn.features.can_clone_databases for conn in connections.all()): return default_test_processes() else: return 1 Loading