@@ -196,7 +196,7 @@ def pytest_terminal_summary(self, terminalreporter):
196196 @pytest .hookimpl (trylast = True )
197197 def pytest_collectreport (self , report ):
198198 if report .failed :
199- self ._process_report (report , 0 )
199+ self ._process_report (report , 0 , [] )
200200
201201 @pytest .hookimpl (trylast = True )
202202 def pytest_collection_finish (self , session ):
@@ -238,16 +238,25 @@ def pytest_runtest_logreport(self, report):
238238 if outcome != "rerun" :
239239 test_duration += reports [0 ].duration
240240
241+ processed_extras = []
242+ for key , reports in self ._reports [report .nodeid ].items ():
243+ when , _ = key
244+ for each in reports :
245+ test_id = report .nodeid
246+ if when != "call" :
247+ test_id += f"::{ when } "
248+ processed_extras += self ._process_extras (each , test_id )
249+
241250 for key , reports in self ._reports [report .nodeid ].items ():
242251 when , _ = key
243252 for each in reports :
244253 dur = test_duration if when == "call" else each .duration
245- self ._process_report (each , dur )
254+ self ._process_report (each , dur , processed_extras )
246255
247256 if self ._config .getini ("generate_report_on_test" ):
248257 self ._generate_report ()
249258
250- def _process_report (self , report , duration ):
259+ def _process_report (self , report , duration , processed_extras ):
251260 outcome = _process_outcome (report )
252261 try :
253262 # hook returns as list for some reason
@@ -262,8 +271,9 @@ def _process_report(self, report, duration):
262271 test_id += f"::{ report .when } "
263272
264273 data = {
265- "extras" : self . _process_extras ( report , test_id ) ,
274+ "extras" : processed_extras ,
266275 }
276+
267277 links = [
268278 extra
269279 for extra in data ["extras" ]
0 commit comments