summaryrefslogtreecommitdiff
path: root/coverage/parser.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-11 10:46:41 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-11 10:46:41 -0400
commitd0d4fa8415a7a64cebe1e490ec0a38a499de95da (patch)
tree6bc21ba78e24937da109cea152b7ff2cddc64c79 /coverage/parser.py
parent0aff68d71faa4938fc28567b0dca1f3413876124 (diff)
downloadpython-coveragepy-git-d0d4fa8415a7a64cebe1e490ec0a38a499de95da.tar.gz
Use @expensive at the FileReporter interface.
Diffstat (limited to 'coverage/parser.py')
-rw-r--r--coverage/parser.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/coverage/parser.py b/coverage/parser.py
index dc067157..014b4ab5 100644
--- a/coverage/parser.py
+++ b/coverage/parser.py
@@ -192,6 +192,7 @@ class PythonParser(object):
for (a, b) in arcs
]
+ @expensive
def parse_source(self):
"""Parse source text to find executable lines, excluded lines, etc.
@@ -225,7 +226,6 @@ class PythonParser(object):
return lines, excluded_lines
- @expensive
def arcs(self):
"""Get information about the arcs available in the code.
@@ -233,10 +233,6 @@ class PythonParser(object):
normalized to the first line of multi-line statements.
"""
- return self.arcs_internal()
-
- def arcs_internal(self):
- """Internal worker to calculate the arcs."""
if self._all_arcs is None:
self._all_arcs = []
for l1, l2 in self.byte_parser._all_arcs():
@@ -246,7 +242,6 @@ class PythonParser(object):
self._all_arcs.append((fl1, fl2))
return self._all_arcs
- @expensive
def exit_counts(self):
"""Get a mapping from line numbers to count of exits from that line.
@@ -255,7 +250,7 @@ class PythonParser(object):
"""
excluded_lines = self.first_lines(self.excluded)
exit_counts = collections.defaultdict(int)
- for l1, l2 in self.arcs_internal():
+ for l1, l2 in self.arcs():
if l1 < 0:
# Don't ever report -1 as a line number
continue