Skip to content

Commit 3cff5e2

Browse files
authored
Merge pull request #5117 from blueyed/cov-terminal
Minor coverage improvements for terminal plugin
2 parents 990133f + 7412df0 commit 3cff5e2

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/_pytest/terminal.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,15 +165,14 @@ def getreportopt(config):
165165
reportchars += "w"
166166
elif config.option.disable_warnings and "w" in reportchars:
167167
reportchars = reportchars.replace("w", "")
168-
if reportchars:
169-
for char in reportchars:
170-
if char == "a":
171-
reportopts = "sxXwEf"
172-
elif char == "A":
173-
reportopts = "sxXwEfpP"
174-
break
175-
elif char not in reportopts:
176-
reportopts += char
168+
for char in reportchars:
169+
if char == "a":
170+
reportopts = "sxXwEf"
171+
elif char == "A":
172+
reportopts = "sxXwEfpP"
173+
break
174+
elif char not in reportopts:
175+
reportopts += char
177176
return reportopts
178177

179178

@@ -855,10 +854,8 @@ def summary_errors(self):
855854
msg = self._getfailureheadline(rep)
856855
if rep.when == "collect":
857856
msg = "ERROR collecting " + msg
858-
elif rep.when == "setup":
859-
msg = "ERROR at setup of " + msg
860-
elif rep.when == "teardown":
861-
msg = "ERROR at teardown of " + msg
857+
else:
858+
msg = "ERROR at %s of %s" % (rep.when, msg)
862859
self.write_sep("_", msg, red=True, bold=True)
863860
self._outrep_summary(rep)
864861

0 commit comments

Comments
 (0)