Skip to content

Commit 41da8a4

Browse files
dckisarahboyce
authored andcommitted
Refs #35849 -- Added a handle_event hook to ParallelTestSuite.
1 parent c4c0762 commit 41da8a4

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

django/test/runner.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -547,18 +547,21 @@ def run(self, result):
547547

548548
tests = list(self.subsuites[subsuite_index])
549549
for event in events:
550-
event_name = event[0]
551-
handler = getattr(result, event_name, None)
552-
if handler is None:
553-
continue
554-
test = tests[event[1]]
555-
args = event[2:]
556-
handler(test, *args)
550+
self.handle_event(result, tests, event)
557551

558552
pool.join()
559553

560554
return result
561555

556+
def handle_event(self, result, tests, event):
557+
event_name = event[0]
558+
handler = getattr(result, event_name, None)
559+
if handler is None:
560+
return
561+
test = tests[event[1]]
562+
args = event[2:]
563+
handler(test, *args)
564+
562565
def __iter__(self):
563566
return iter(self.subsuites)
564567

0 commit comments

Comments
 (0)