summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coverage/collector.py12
-rw-r--r--coverage/data.py3
-rw-r--r--coverage/plugin.py6
3 files changed, 12 insertions, 9 deletions
diff --git a/coverage/collector.py b/coverage/collector.py
index 3f557aa5..57c35605 100644
--- a/coverage/collector.py
+++ b/coverage/collector.py
@@ -129,10 +129,12 @@ class Collector(object):
def reset(self):
"""Clear collected data, and prepare to collect more."""
- # A dictionary mapping filenames to dicts with line number keys,
- # or mapping filenames to dicts with line number pairs as keys.
+ # A dictionary mapping filenames to dicts with line number keys (if not
+ # branch coverage), or mapping filenames to dicts with line number
+ # pairs as keys (if branch coverage).
self.data = {}
+ # A dictionary mapping filenames to plugin names that will handle them.
self.plugin_data = {}
# The .should_trace_cache attribute is a cache from filenames to
@@ -322,4 +324,10 @@ class Collector(object):
return {}
def get_plugin_data(self):
+ """Return the mapping of source files to plugins.
+
+ Returns:
+ dict: { filename: plugin_name, ... }
+
+ """
return self.plugin_data
diff --git a/coverage/data.py b/coverage/data.py
index 22b711d1..59ebae2f 100644
--- a/coverage/data.py
+++ b/coverage/data.py
@@ -24,8 +24,6 @@ class CoverageData(object):
* plugins: a dict mapping filenames to plugin names:
{ 'file1': "django.coverage", ... }
- # TODO: how to handle the difference between a plugin module
- # name, and the class in the module?
"""
@@ -126,6 +124,7 @@ class CoverageData(object):
)
def plugin_data(self):
+ """Return the map from filenames to plugin names."""
return self.plugins
def write_file(self, filename):
diff --git a/coverage/plugin.py b/coverage/plugin.py
index 3fbb43aa..678d297a 100644
--- a/coverage/plugin.py
+++ b/coverage/plugin.py
@@ -171,11 +171,7 @@ class FileReporter(object):
self.filename = filename
def __repr__(self):
- return (
- # pylint: disable=redundant-keyword-arg
- "<{self.__class__.__name__}"
- " filename={self.filename!r}>".format(self=self)
- )
+ return "<{0.__class__.__name__} filename={0.filename!r}>".format(self)
def relative_filename(self):
return files.relative_filename(self.filename)