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
commitc317727542e303ae9dd5ed4db73217508e367d74 (patch)
treea10fcf53481e773f1ab97eef8188b89172a68404 /coverage/results.py
parenta63bf56c15835c763f60ff0ba3f782c8fb86363c (diff)
downloadpython-coveragepy-git-c317727542e303ae9dd5ed4db73217508e367d74.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 c9034bcd..6cbcbfc8 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):