summaryrefslogtreecommitdiff
path: root/tests/test_runner/test_parallel.py
diff options
context:
space:
mode:
authorShubham Singh <ssingh@multimediallc.com>2025-09-12 14:32:35 -0500
committerJacob Walls <jacobtylerwalls@gmail.com>2025-09-26 10:55:30 -0400
commitbe581ff473e8ade6365975db2df602f295a4cb4b (patch)
treeebdf83c41d1acc971d548cbbc22d35b2ab11ee28 /tests/test_runner/test_parallel.py
parent1cb76b90e844308ae21d24115311bc354efe56e6 (diff)
Fixed #36491 -- Fixed crash in ParallelTestRunner with --buffer.
Thanks Javier Buzzi and Adam Johnson for reviews. Co-authored-by: Simon Charette <charette.s@gmail.com>
Diffstat (limited to 'tests/test_runner/test_parallel.py')
-rw-r--r--tests/test_runner/test_parallel.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_runner/test_parallel.py b/tests/test_runner/test_parallel.py
index f344f1a2db..d4558018b0 100644
--- a/tests/test_runner/test_parallel.py
+++ b/tests/test_runner/test_parallel.py
@@ -282,3 +282,27 @@ class ParallelTestSuiteTest(SimpleTestCase):
self.assertEqual(len(result.errors), 0)
self.assertEqual(len(result.failures), 0)
+
+ def test_buffer_mode_reports_setupclass_failure(self):
+ test = SampleErrorTest("dummy_test")
+ remote_result = RemoteTestResult()
+ suite = TestSuite([test])
+ suite.run(remote_result)
+
+ pts = ParallelTestSuite([suite], processes=2, buffer=True)
+ pts.serialized_aliases = set()
+ test_result = TestResult()
+ test_result.buffer = True
+
+ with unittest.mock.patch("multiprocessing.Pool") as mock_pool:
+
+ def fake_next(*args, **kwargs):
+ test_result.shouldStop = True
+ return (0, remote_result.events)
+
+ mock_pool.return_value.imap_unordered.return_value = unittest.mock.Mock(
+ next=fake_next
+ )
+ pts.run(test_result)
+
+ self.assertIn("ValueError: woops", test_result.errors[0][1])