summaryrefslogtreecommitdiff
path: root/coverage/results.py
diff options
context:
space:
mode:
authorSteve <sleonard76@gmail.com>2014-05-26 13:42:02 -0400
committerSteve <sleonard76@gmail.com>2014-05-26 13:42:02 -0400
commit8c2cea536675e503e2eb78fd94e04f9635129e26 (patch)
tree07bfe64e6f8ffb7fb3f5814ba3c9deec46385fd4 /coverage/results.py
parenta91fb5b97886f23f78deaaaeb42daf20b898acff (diff)
downloadpython-coveragepy-8c2cea536675e503e2eb78fd94e04f9635129e26.tar.gz
Fix formatting when no missing lines; improve tests
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()