mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #31169 -- Adapted the parallel test runner to use spawn.
Co-authored-by: Valz <ahmadahussein0@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
This commit is contained in:
committed by
Carlton Gibson
parent
3eaba13a47
commit
3b3f38b3b0
@@ -86,6 +86,16 @@ class DiscoverRunnerParallelArgumentTests(SimpleTestCase):
|
||||
mocked_cpu_count,
|
||||
):
|
||||
mocked_get_start_method.return_value = "spawn"
|
||||
self.assertEqual(get_max_test_processes(), 12)
|
||||
with mock.patch.dict(os.environ, {"DJANGO_TEST_PROCESSES": "7"}):
|
||||
self.assertEqual(get_max_test_processes(), 7)
|
||||
|
||||
def test_get_max_test_processes_forkserver(
|
||||
self,
|
||||
mocked_get_start_method,
|
||||
mocked_cpu_count,
|
||||
):
|
||||
mocked_get_start_method.return_value = "forkserver"
|
||||
self.assertEqual(get_max_test_processes(), 1)
|
||||
with mock.patch.dict(os.environ, {"DJANGO_TEST_PROCESSES": "7"}):
|
||||
self.assertEqual(get_max_test_processes(), 1)
|
||||
|
||||
Reference in New Issue
Block a user