summaryrefslogtreecommitdiff
path: root/coverage
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-16 15:41:15 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-16 15:41:15 -0400
commit73d5eab6fe1178edecc3eee7645a897db5b8c81f (patch)
tree9e86e4ebc1b004d7951b8ed70e609d9e23fff67d /coverage
parent5a609b662e97b1a3728467d2056ca63e3984af75 (diff)
downloadpython-coveragepy-git-73d5eab6fe1178edecc3eee7645a897db5b8c81f.tar.gz
Change CoverageData.summary() to CoverageData.line_counts()
Diffstat (limited to 'coverage')
-rw-r--r--coverage/cmdline.py2
-rw-r--r--coverage/data.py9
2 files changed, 8 insertions, 3 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 0620c8ee..1a8a0268 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -589,7 +589,7 @@ class CoverageScript(object):
print(info_header("data"))
print("path: %s" % self.coverage.data.filename)
print("has_arcs: %r" % self.coverage.data.has_arcs())
- summary = self.coverage.data.summary(fullpath=True)
+ summary = self.coverage.data.line_counts(fullpath=True)
if summary:
plugins = self.coverage.data.plugin_data()
filenames = sorted(summary.keys())
diff --git a/coverage/data.py b/coverage/data.py
index c9e9a036..0f9a4cfd 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -213,13 +213,18 @@ class CoverageData(object):
hasher.update(self.lines(filename))
hasher.update(self.arcs(filename))
- def summary(self, fullpath=False):
- """Return a dict summarizing the coverage data.
+ def line_counts(self, fullpath=False):
+ """Return a dict summarizing the line coverage data.
Keys are based on the filenames, and values are the number of executed
lines. If `fullpath` is true, then the keys are the full pathnames of
the files, otherwise they are the basenames of the files.
+ This is used for testing, not for actual use in the product.
+
+ Returns:
+ dict mapping filenames to counts of lines.
+
"""
summ = {}
if fullpath: