Rename "warnings" to "pytest-warnings" in terminal output

Fix #970
This commit is contained in:
Bruno Oliveira
2015-08-27 19:59:52 -03:00
parent 06b1b69fb7
commit e59471766a
4 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -326,7 +326,7 @@ def testdir(request, tmpdir_factory):
return Testdir(request, tmpdir_factory)
rex_outcome = re.compile("(\d+) (\w+)")
rex_outcome = re.compile("(\d+) ([\w-]+)")
class RunResult:
"""The result of running a command.
+4 -2
View File
@@ -438,7 +438,7 @@ class TerminalReporter:
warnings = self.stats.get("warnings")
if not warnings:
return
self.write_sep("=", "warning summary")
self.write_sep("=", "pytest-warning summary")
for w in warnings:
self._tw.line("W%s %s %s" % (w.code,
w.fslocation, w.message))
@@ -527,6 +527,7 @@ def flatten(l):
def build_summary_stats_line(stats):
keys = ("failed passed skipped deselected "
"xfailed xpassed warnings error").split()
key_translation = {'warnings': 'pytest-warnings'}
unknown_key_seen = False
for key in stats.keys():
if key not in keys:
@@ -537,7 +538,8 @@ def build_summary_stats_line(stats):
for key in keys:
val = stats.get(key, None)
if val:
parts.append("%d %s" % (len(val), key))
key_name = key_translation.get(key, key)
parts.append("%d %s" % (len(val), key_name))
line = ", ".join(parts)
if 'failed' in stats or 'error' in stats: