diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-12-24 08:49:50 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-12-24 08:49:50 -0500 |
commit | b17f27672208a07318f8aa62a1bd64b18e9961d1 (patch) | |
tree | 450d61783f4aff46a5f07c2b78ca3fcd27228aca /coverage/results.py | |
parent | ae91d45616dbc4dddcd66955b41ffb5fa420ddda (diff) | |
download | python-coveragepy-git-b17f27672208a07318f8aa62a1bd64b18e9961d1.tar.gz |
WIP: measure branches with ast instead of bytecode
--HG--
branch : ast-branch
Diffstat (limited to 'coverage/results.py')
-rw-r--r-- | coverage/results.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coverage/results.py b/coverage/results.py index 9627373d..b80d5042 100644 --- a/coverage/results.py +++ b/coverage/results.py @@ -26,6 +26,7 @@ class Analysis(object): if self.data.has_arcs(): self._arc_possibilities = sorted(self.file_reporter.arcs()) + self._ast_arc_possibilities = sorted(self.file_reporter.ast_arcs()) self.exit_counts = self.file_reporter.exit_counts() self.no_branch = self.file_reporter.no_branch_lines() n_branches = self.total_branches() @@ -36,6 +37,7 @@ class Analysis(object): n_missing_branches = sum(len(v) for k,v in iitems(mba)) else: self._arc_possibilities = [] + self._ast_arc_possibilities = [] self.exit_counts = {} self.no_branch = set() n_branches = n_partial_branches = n_missing_branches = 0 @@ -66,6 +68,9 @@ class Analysis(object): """Returns a sorted list of the arcs in the code.""" return self._arc_possibilities + def ast_arc_possibilities(self): + return self._ast_arc_possibilities + def arcs_executed(self): """Returns a sorted list of the arcs actually executed in the code.""" executed = self.data.arcs(self.filename) or [] |