summaryrefslogtreecommitdiff
path: root/coverage/report.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-05-20 10:30:09 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-05-20 10:30:09 -0400
commitaeaaa1ff0cc7c7c9674a9379e6388d6f0a950f3a (patch)
tree90404d0d8388c7bed5a30260d059dc6fb417e2cf /coverage/report.py
parentd3e55fd68d21d9629338edb5ee54222343172380 (diff)
downloadpython-coveragepy-git-aeaaa1ff0cc7c7c9674a9379e6388d6f0a950f3a.tar.gz
Restore Reporter.file_reporters, with a deprecation warning.
Diffstat (limited to 'coverage/report.py')
-rw-r--r--coverage/report.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/coverage/report.py b/coverage/report.py
index c3d59af1..0d1519f5 100644
--- a/coverage/report.py
+++ b/coverage/report.py
@@ -4,6 +4,7 @@
"""Reporter foundation for coverage.py."""
import os
+import warnings
from coverage.files import prep_patterns, FnmatchMatcher
from coverage.misc import CoverageException, NoSource, NotPython, isolate_module
@@ -28,6 +29,20 @@ class Reporter(object):
# classes.
self.directory = None
+ # Our method find_file_reporters used to set an attribute that other
+ # code could read. That's been refactored away, but some third parties
+ # were using that attribute. We'll continue to support it in a noisy
+ # way for now.
+ self._file_reporters = []
+
+ @property
+ def file_reporters(self):
+ warnings.warn(
+ "Report.file_reporters will no longer be available in Coverage.py 4.2",
+ DeprecationWarning,
+ )
+ return self._file_reporters
+
def find_file_reporters(self, morfs):
"""Find the FileReporters we'll report on.
@@ -46,7 +61,8 @@ class Reporter(object):
matcher = FnmatchMatcher(prep_patterns(self.config.omit))
reporters = [fr for fr in reporters if not matcher.match(fr.filename)]
- return sorted(reporters)
+ self._file_reporters = sorted(reporters)
+ return self._file_reporters
def report_files(self, report_fn, morfs, directory=None):
"""Run a reporting function on a number of morfs.