diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-05-31 23:12:40 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-05-31 23:12:40 -0400 |
commit | 139497ac9cf495a13e9f3323db489bf56054f5d4 (patch) | |
tree | eae49dfbee407d333ef61618351936ded5945297 /coverage/results.py | |
parent | 61deec574e9d0181ad986d1276e3d57e8427930d (diff) | |
download | python-coveragepy-git-139497ac9cf495a13e9f3323db489bf56054f5d4.tar.gz |
Better handling of the partial-branch exclusion regexes. Finishes issue #113.
Diffstat (limited to 'coverage/results.py')
-rw-r--r-- | coverage/results.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/coverage/results.py b/coverage/results.py index 7b032f18..adfb8f42 100644 --- a/coverage/results.py +++ b/coverage/results.py @@ -25,7 +25,7 @@ class Analysis(object): self.parser = CodeParser( text=source, filename=self.filename, - exclude=self.coverage.exclude_re + exclude=self.coverage._exclude_regex('exclude') ) self.statements, self.excluded = self.parser.parse_source() @@ -70,8 +70,6 @@ class Analysis(object): def arc_possibilities(self): """Returns a sorted list of the arcs in the code.""" arcs = self.parser.arcs() - if self.no_branch: - arcs = [(a,b) for (a,b) in arcs if a not in self.no_branch] return arcs def arcs_executed(self): @@ -85,7 +83,11 @@ class Analysis(object): """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] + missing = [ + p for p in possible + if p not in executed + and p[0] not in self.no_branch + ] return sorted(missing) def arcs_unpredicted(self): @@ -99,7 +101,6 @@ class Analysis(object): e for e in executed if e not in possible and e[0] != e[1] - and e[0] not in self.no_branch ] return sorted(unpredicted) |