From fd2d30dfdba0df793ae39c47be6da07138724b1e Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 8 Nov 2009 17:57:40 -0500 Subject: Don't include excluded lines when reporting exit counts. --- coverage/parser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'coverage/parser.py') 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 -- cgit v1.2.1