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
commit4015f0c26cab47f82fd9882ab8c9bf5d29ae7ca0 (patch)
tree0a2a92253455650e28b10178feae955cc58a5c2c /coverage/results.py
parent12e05dbdbedea2c668ce90cb19da34476dccaca8 (diff)
parent232b546e7325be1626f940e5358fe468f3f06872 (diff)
downloadpython-coveragepy-git-4015f0c26cab47f82fd9882ab8c9bf5d29ae7ca0.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 ce9e0fa4..94785ca0 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()