Merge pull request #5117 from blueyed/cov-terminal

Minor coverage improvements for terminal plugin
This commit is contained in:
Anthony Sottile 2019-04-15 14:30:18 -07:00 committed by GitHub
commit 3cff5e252d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 13 deletions

View File

@ -165,15 +165,14 @@ def getreportopt(config):
reportchars += "w"
elif config.option.disable_warnings and "w" in reportchars:
reportchars = reportchars.replace("w", "")
if reportchars:
for char in reportchars:
if char == "a":
reportopts = "sxXwEf"
elif char == "A":
reportopts = "sxXwEfpP"
break
elif char not in reportopts:
reportopts += char
for char in reportchars:
if char == "a":
reportopts = "sxXwEf"
elif char == "A":
reportopts = "sxXwEfpP"
break
elif char not in reportopts:
reportopts += char
return reportopts
@ -855,10 +854,8 @@ class TerminalReporter(object):
msg = self._getfailureheadline(rep)
if rep.when == "collect":
msg = "ERROR collecting " + msg
elif rep.when == "setup":
msg = "ERROR at setup of " + msg
elif rep.when == "teardown":
msg = "ERROR at teardown of " + msg
else:
msg = "ERROR at %s of %s" % (rep.when, msg)
self.write_sep("_", msg, red=True, bold=True)
self._outrep_summary(rep)