mirror of
https://github.com/django/django.git
synced 2024-11-20 16:34:17 +00:00
Refs #35849 -- Added a handle_event hook to ParallelTestSuite.
This commit is contained in:
parent
c4c076223e
commit
41da8a4f5a
@ -547,18 +547,21 @@ class ParallelTestSuite(unittest.TestSuite):
|
||||
|
||||
tests = list(self.subsuites[subsuite_index])
|
||||
for event in events:
|
||||
event_name = event[0]
|
||||
handler = getattr(result, event_name, None)
|
||||
if handler is None:
|
||||
continue
|
||||
test = tests[event[1]]
|
||||
args = event[2:]
|
||||
handler(test, *args)
|
||||
self.handle_event(result, tests, event)
|
||||
|
||||
pool.join()
|
||||
|
||||
return result
|
||||
|
||||
def handle_event(self, result, tests, event):
|
||||
event_name = event[0]
|
||||
handler = getattr(result, event_name, None)
|
||||
if handler is None:
|
||||
return
|
||||
test = tests[event[1]]
|
||||
args = event[2:]
|
||||
handler(test, *args)
|
||||
|
||||
def __iter__(self):
|
||||
return iter(self.subsuites)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user