Refactor slightly

Check for the empty-key special case in the first loop,
not the second.
This commit is contained in:
Eric Siegerman 2015-06-30 19:06:28 -04:00
parent e07144aeb4
commit 0282da9ddf
1 changed files with 5 additions and 5 deletions

View File

@ -530,13 +530,13 @@ def build_summary_stats_line(stats):
"xfailed xpassed warnings").split() "xfailed xpassed warnings").split()
for key in stats.keys(): for key in stats.keys():
if key not in keys: if key not in keys:
keys.append(key) if key: # setup/teardown reports have an empty key, ignore them
keys.append(key)
parts = [] parts = []
for key in keys: for key in keys:
if key: # setup/teardown reports have an empty key, ignore them val = stats.get(key, None)
val = stats.get(key, None) if val:
if val: parts.append("%d %s" % (len(val), key))
parts.append("%d %s" % (len(val), key))
line = ", ".join(parts) line = ", ".join(parts)
if 'failed' in stats or 'error' in stats: if 'failed' in stats or 'error' in stats: