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
commit43e24381c30e711025a57de31ebf9ee91a444d8b (patch)
treeb66589d0f3f858b7b23e022874a794bbfe9d8f12 /coverage/parser.py
parent83e708345130d5b2128348908f2e6139f2ad6be3 (diff)
downloadpython-coveragepy-43e24381c30e711025a57de31ebf9ee91a444d8b.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 dc06715..014b4ab 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