Skip to content

Commit cc78a53

Browse files
committed
terminal: summary_errors: replace if with assert
1 parent fd0b3e2 commit cc78a53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/_pytest/terminal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,8 @@ def summary_errors(self):
851851
msg = "ERROR collecting " + msg
852852
elif rep.when == "setup":
853853
msg = "ERROR at setup of " + msg
854-
elif rep.when == "teardown":
854+
else:
855+
assert rep.when == "teardown", "Unexpected rep: %r" % (rep,)
855856
msg = "ERROR at teardown of " + msg
856857
self.write_sep("_", msg, red=True, bold=True)
857858
self._outrep_summary(rep)

0 commit comments

Comments
 (0)