summaryrefslogtreecommitdiff
path: root/coverage/results.py
diff options
context:
space:
mode:
authorNed Batchelder <nedbat@gmail.com>2014-06-01 21:07:27 -0400
committerNed Batchelder <nedbat@gmail.com>2014-06-01 21:07:27 -0400
commitc2ac1b4a7b6b7295cdbf24b02ed163ec2c73b3ec (patch)
treeae03ee19b9769d417082b213a446fdb9f3c71a5c /coverage/results.py
parent3726a8b72e4148f7de0a1fa2fd20ecafa151eb49 (diff)
parent64999a94688fa83c769fde934d1934e95754efcd (diff)
downloadpython-coveragepy-c2ac1b4a7b6b7295cdbf24b02ed163ec2c73b3ec.tar.gz
Merged in rdn_/coverage.py (pull request #35)
Add branch misses to stdout report
Diffstat (limited to 'coverage/results.py')
-rw-r--r--coverage/results.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/coverage/results.py b/coverage/results.py
index ce9e0fa..94785ca 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -83,6 +83,22 @@ class Analysis(object):
)
return sorted(missing)
+ def arcs_missing_formatted(self):
+ """ The missing branch arcs, formatted.
+
+ Returns a string like "1->2, 1->3, 16->20"
+
+ """
+ arcs = self.missing_branch_arcs()
+ line_exits = sorted(arcs.iteritems(), key=lambda (x, _): x)
+ pairs = []
+ for line, exits in line_exits:
+ exits = sorted(exits)
+ for exit in exits:
+ pair = '%d->%d' % (line, exit)
+ pairs.append(pair)
+ return ', '.join(pairs)
+
def arcs_unpredicted(self):
"""Returns a sorted list of the executed arcs missing from the code."""
possible = self.arc_possibilities()