summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/data.py11
-rw-r--r--coverage/results.py4
-rw-r--r--tests/test_arcs.py2
-rw-r--r--tests/test_concurrency.py2
-rw-r--r--tests/test_oddball.py2
5 files changed, 11 insertions, 10 deletions
diff --git a/coverage/data.py b/coverage/data.py
index 975c0384..fb0fdb97 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -77,11 +77,11 @@ class CoverageData(object):
self._arcs = {}
self._plugins = {}
- def line_data(self, filename):
+ def lines(self, filename):
"""Get the list of lines executed for a file."""
return list((self._lines.get(filename) or {}).keys())
- def arc_data(self, filename):
+ def arcs(self, filename):
"""Get the list of arcs executed for a file."""
return list((self._arcs.get(filename) or {}).keys())
@@ -182,7 +182,8 @@ class CoverageData(object):
self._plugins.update(plugin_data)
def update(self, other_data, aliases=None):
- """
+ """Update this data with data from another `CoverageData`.
+
If `aliases` is provided, it's a `PathAliases` object that is used to
re-map paths to match the local machine's.
@@ -206,8 +207,8 @@ class CoverageData(object):
def add_to_hash(self, filename, hasher):
"""Contribute `filename`'s data to the Md5Hash `hasher`."""
- hasher.update(self.line_data(filename))
- hasher.update(self.arc_data(filename))
+ hasher.update(self.lines(filename))
+ hasher.update(self.arcs(filename))
def summary(self, fullpath=False):
"""Return a dict summarizing the coverage data.
diff --git a/coverage/results.py b/coverage/results.py
index 678f4962..65e70c75 100644
--- a/coverage/results.py
+++ b/coverage/results.py
@@ -17,7 +17,7 @@ class Analysis(object):
self.excluded = self.file_reporter.excluded_statements()
# Identify missing statements.
- executed = self.data.line_data(self.filename)
+ executed = self.data.lines(self.filename)
executed = self.file_reporter.translate_lines(executed)
self.missing = self.statements - executed
@@ -61,7 +61,7 @@ class Analysis(object):
def arcs_executed(self):
"""Returns a sorted list of the arcs actually executed in the code."""
- executed = self.data.arc_data(self.filename)
+ executed = self.data.arcs(self.filename)
executed = self.file_reporter.translate_arcs(executed)
return sorted(executed)
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index c84c5441..7e8541a4 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -761,5 +761,5 @@ class LineDataTest(CoverageTest):
self.start_import_stop(cov, "fun1")
data = cov.get_data()
- fun1_lines = data.line_data(abs_file("fun1.py"))
+ fun1_lines = data.lines(abs_file("fun1.py"))
self.assertEqual(fun1_lines, [1, 2, 5])
diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py
index 21048941..e0eacd18 100644
--- a/tests/test_concurrency.py
+++ b/tests/test_concurrency.py
@@ -149,7 +149,7 @@ class ConcurrencyTest(CoverageTest):
# If the test fails, it's helpful to see this info:
fname = os.path.abspath("try_it.py")
- linenos = data.line_data(fname)
+ linenos = data.lines(fname)
print("{0}: {1}".format(len(linenos), linenos))
print_simple_annotation(code, linenos)
diff --git a/tests/test_oddball.py b/tests/test_oddball.py
index 5288f022..1c92273b 100644
--- a/tests/test_oddball.py
+++ b/tests/test_oddball.py
@@ -323,7 +323,7 @@ class ExceptionTest(CoverageTest):
data = cov.get_data()
for callname in callnames:
filename = callname + ".py"
- lines = data.line_data(abs_file(filename))
+ lines = data.lines(abs_file(filename))
clean_lines[filename] = sorted(lines)
self.assertEqual(clean_lines, lines_expected)