mirror of
https://github.com/django/django.git
synced 2025-10-24 22:26:08 +00:00
Fixed #36083 -- Ran system checks in ParallelTestSuite workers.
Workers created by ParallelTestSuite were not running system checks in the spawn multiprocessing mode. In general this is fine, but system checks can have side effects expected by tests. This patch runs system checks inside of _init_worker, which is only called by ParallelTestSuite.
This commit is contained in:
committed by
Jacob Walls
parent
2063c88c34
commit
606fc35279
@@ -8,6 +8,8 @@ from unittest.suite import TestSuite, _ErrorHolder
|
||||
from django.test import SimpleTestCase
|
||||
from django.test.runner import ParallelTestSuite, RemoteTestResult
|
||||
|
||||
from . import models
|
||||
|
||||
try:
|
||||
import tblib.pickling_support
|
||||
except ImportError:
|
||||
@@ -48,6 +50,9 @@ class ParallelTestRunnerTest(SimpleTestCase):
|
||||
with self.subTest(index=i):
|
||||
self.assertEqual(i, i)
|
||||
|
||||
def test_system_checks(self):
|
||||
self.assertEqual(models.Person.system_check_run_count, 1)
|
||||
|
||||
|
||||
class SampleFailingSubtest(SimpleTestCase):
|
||||
# This method name doesn't begin with "test" to prevent test discovery
|
||||
|
||||
Reference in New Issue
Block a user