@@ -196,7 +196,7 @@ def pytest_terminal_summary(self, terminalreporter):
196
196
@pytest .hookimpl (trylast = True )
197
197
def pytest_collectreport (self , report ):
198
198
if report .failed :
199
- self ._process_report (report , 0 )
199
+ self ._process_report (report , 0 , [] )
200
200
201
201
@pytest .hookimpl (trylast = True )
202
202
def pytest_collection_finish (self , session ):
@@ -238,16 +238,25 @@ def pytest_runtest_logreport(self, report):
238
238
if outcome != "rerun" :
239
239
test_duration += reports [0 ].duration
240
240
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
+
241
250
for key , reports in self ._reports [report .nodeid ].items ():
242
251
when , _ = key
243
252
for each in reports :
244
253
dur = test_duration if when == "call" else each .duration
245
- self ._process_report (each , dur )
254
+ self ._process_report (each , dur , processed_extras )
246
255
247
256
if self ._config .getini ("generate_report_on_test" ):
248
257
self ._generate_report ()
249
258
250
- def _process_report (self , report , duration ):
259
+ def _process_report (self , report , duration , processed_extras ):
251
260
outcome = _process_outcome (report )
252
261
try :
253
262
# hook returns as list for some reason
@@ -262,8 +271,9 @@ def _process_report(self, report, duration):
262
271
test_id += f"::{ report .when } "
263
272
264
273
data = {
265
- "extras" : self . _process_extras ( report , test_id ) ,
274
+ "extras" : processed_extras ,
266
275
}
276
+
267
277
links = [
268
278
extra
269
279
for extra in data ["extras" ]
0 commit comments