summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-24 14:36:24 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-24 14:36:24 -0400
commit0e9683111708fc0935bc576db6e27c39f127915c (patch)
tree7d8fea0e034fc5ab267b74ac0f1f69b9ca71ce34 /coverage/control.py
parent9177b39fb37d695807c0b28f1db1477f435a5466 (diff)
downloadpython-coveragepy-git-0e9683111708fc0935bc576db6e27c39f127915c.tar.gz
Cleanup, and write doc strings.
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 9638c2d1..d406e80c 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -363,28 +363,37 @@ class Analysis(object):
# Identify missing statements.
self.missing = []
self.executed = self.coverage.data.executed_lines(self.filename)
- exec1 = self.parser._map_to_first_lines(self.executed)
+ exec1 = self.parser.first_lines(self.executed)
self.missing = sorted(set(self.statements) - set(exec1))
def missing_formatted(self):
+ """The missing line numbers, formatted nicely.
+
+ Returns a string like "1-2, 5-11, 13-14".
+
+ """
return format_lines(self.statements, self.missing)
def arc_possibilities(self):
- return self.parser.arc_info()
+ """Returns a sorted list of the arcs in the code."""
+ return self.parser.arcs()
def arcs_executed(self):
+ """Returns a sorted list of the arcs actually executed in the code."""
executed = self.coverage.data.executed_arcs(self.filename)
- m2fl = self.parser._map_to_first_line
+ m2fl = self.parser.first_line
executed = [(m2fl(l1), m2fl(l2)) for (l1,l2) in executed]
- return executed
+ return sorted(executed)
def arcs_missing(self):
+ """Returns a sorted list of the arcs in the code not executed."""
possible = self.arc_possibilities()
executed = self.arcs_executed()
missing = [p for p in possible if p not in executed]
return sorted(missing)
def arcs_unpredicted(self):
+ """Returns a sorted list of the executed arcs missing from the code."""
possible = self.arc_possibilities()
executed = self.arcs_executed()
# Exclude arcs here which connect a line to itself. They can occur