terminal: summary_errors: replace if with assert

This commit is contained in:
Daniel Hahler 2019-04-14 23:17:09 +02:00
parent fd0b3e2e8b
commit cc78a533ae
1 changed files with 2 additions and 1 deletions

View File

@ -851,7 +851,8 @@ class TerminalReporter(object):
msg = "ERROR collecting " + msg
elif rep.when == "setup":
msg = "ERROR at setup of " + msg
elif rep.when == "teardown":
else:
assert rep.when == "teardown", "Unexpected rep: %r" % (rep,)
msg = "ERROR at teardown of " + msg
self.write_sep("_", msg, red=True, bold=True)
self._outrep_summary(rep)