summaryrefslogtreecommitdiff
path: root/coverage/parser.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-11-08 17:57:40 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-11-08 17:57:40 -0500
commitfd2d30dfdba0df793ae39c47be6da07138724b1e (patch)
tree4e9298355931b0c3257da82d30d77c7c51b1628b /coverage/parser.py
parent5ed5253d89664d675566b8ea36677a75158ede4b (diff)
downloadpython-coveragepy-git-fd2d30dfdba0df793ae39c47be6da07138724b1e.tar.gz
Don't include excluded lines when reporting exit counts.
Diffstat (limited to 'coverage/parser.py')
-rw-r--r--coverage/parser.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index 4890aa6f..ee07c20c 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -195,11 +195,18 @@ class CodeParser(object):
return sorted(all_arcs)
def exit_counts(self):
- """Return a dict mapping line numbers to number of exits from that line."""
+ """Get a mapping from line numbers to count of exits from that line.
+
+ Excluded lines are excluded.
+
+ """
+ excluded_lines = self.first_lines(self.excluded)
exit_counts = {}
for l1,l2 in self.arcs():
if l1 == -1:
continue
+ if l1 in excluded_lines:
+ continue
if l1 not in exit_counts:
exit_counts[l1] = 0
exit_counts[l1] += 1