summaryrefslogtreecommitdiff
path: root/coverage/results.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2014-07-08 06:25:17 -0400
committerNed Batchelder <ned@nedbatchelder.com>2014-07-08 06:25:17 -0400
commit0e0c961754d175ce207008c350614b2eb4aded3c (patch)
treec0faa054531afbb41e65d162f899d65297d6f28c /coverage/results.py
parent0baac6cd272fe328193b34ad8b562d53ef0f6bb4 (diff)
downloadpython-coveragepy-0e0c961754d175ce207008c350614b2eb4aded3c.tar.gz
Improve branch summarization
It failed completely on more than one file! Removed the Branches label, and no longer report missing branches implied by missing lines.
Diffstat (limited to 'coverage/results.py')
-rw-r--r--coverage/results.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/coverage/results.py b/coverage/results.py
index c9034bc..6cbcbfc 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -84,18 +84,20 @@ class Analysis(object):
return sorted(missing)
def arcs_missing_formatted(self):
- """ The missing branch arcs, formatted.
+ """ The missing branch arcs, formatted nicely.
- Returns a string like "1->2, 1->3, 16->20"
+ Returns a string like "1->2, 1->3, 16->20". Omits any mention of
+ missing lines, so if line 17 is missing, then 16->17 won't be included.
"""
arcs = self.missing_branch_arcs()
+ missing = self.missing
line_exits = sorted(iitems(arcs))
pairs = []
for line, exits in line_exits:
for ex in sorted(exits):
- pair = '%d->%d' % (line, ex)
- pairs.append(pair)
+ if line not in missing and ex not in missing:
+ pairs.append('%d->%d' % (line, ex))
return ', '.join(pairs)
def arcs_unpredicted(self):