File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -828,17 +828,22 @@ def summary_failures(self):
828828 if not reports :
829829 return
830830 self .write_sep ("=" , "FAILURES" )
831- for rep in reports :
832- if self . config . option . tbstyle == "line" :
831+ if self . config . option . tbstyle == "line" :
832+ for rep in reports :
833833 line = self ._getcrashline (rep )
834834 self .write_line (line )
835- else :
835+ else :
836+ teardown_sections = {}
837+ for report in self .getreports ("" ):
838+ if report .when == "teardown" :
839+ teardown_sections .setdefault (report .nodeid , []).append (report )
840+
841+ for rep in reports :
836842 msg = self ._getfailureheadline (rep )
837843 self .write_sep ("_" , msg , red = True , bold = True )
838844 self ._outrep_summary (rep )
839- for report in self .getreports ("" ):
840- if report .nodeid == rep .nodeid and report .when == "teardown" :
841- self .print_teardown_sections (report )
845+ for report in teardown_sections .get (rep .nodeid , []):
846+ self .print_teardown_sections (report )
842847
843848 def summary_errors (self ):
844849 if self .config .option .tbstyle != "no" :
You can’t perform that action at this time.
0 commit comments