diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2016-05-20 10:30:09 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2016-05-20 10:30:09 -0400 |
commit | fffbba825cc289b596828fd6542b8a9f7f79074a (patch) | |
tree | c425203b540bdd5c0827ca48568acf9b3228cc11 /coverage/report.py | |
parent | b3ccb992e084503e6718680a24b9efaee1b24c2c (diff) | |
download | python-coveragepy-fffbba825cc289b596828fd6542b8a9f7f79074a.tar.gz |
Restore Reporter.file_reporters, with a deprecation warning.
Diffstat (limited to 'coverage/report.py')
-rw-r--r-- | coverage/report.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/coverage/report.py b/coverage/report.py index c3d59af..0d1519f 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. |