summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-05-20 15:08:02 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-05-20 15:08:02 -0400
commit00f15ba0a5731aa1b1ef0db85608a45f78a3f160 (patch)
treebd2d734768e638c2debd8465c6b378f61a91e565
parent8049de611424191b3d530c509485fd2587b2d4cb (diff)
downloadpython-coveragepy-git-00f15ba0a5731aa1b1ef0db85608a45f78a3f160.tar.gz
Clean ups
-rw-r--r--CHANGES.rst2
-rw-r--r--coverage/report.py1
-rw-r--r--tests/test_api.py5
3 files changed, 6 insertions, 2 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 0d8a6d8e..8eac9a3b 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -12,7 +12,7 @@ Unreleased
- The internal attribute `Reporter.file_reporters` was removed in 4.1b3. It
should have come has no surprise that there were third-party tools out there
using that attribute. It has been restored, but with a deprecation warning.
-
+
Version 4.1b3 --- 2016-05-10
----------------------------
diff --git a/coverage/report.py b/coverage/report.py
index 0d1519f5..2ffbbaa5 100644
--- a/coverage/report.py
+++ b/coverage/report.py
@@ -37,6 +37,7 @@ class Reporter(object):
@property
def file_reporters(self):
+ """Keep .file_reporters working for private-grabbing tools."""
warnings.warn(
"Report.file_reporters will no longer be available in Coverage.py 4.2",
DeprecationWarning,
diff --git a/tests/test_api.py b/tests/test_api.py
index 55cdbe8d..f4ab2bae 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -571,8 +571,11 @@ class ReporterDeprecatedAttributeTest(CoverageTest):
def test_reporter_file_reporters(self):
rep = Reporter(None, None)
+
with warnings.catch_warnings(record=True) as warns:
warnings.simplefilter("always")
- rep.file_reporters
+ # Accessing this attribute will raise a DeprecationWarning.
+ rep.file_reporters # pylint: disable=pointless-statement
+
self.assertEqual(len(warns), 1)
self.assertTrue(issubclass(warns[0].category, DeprecationWarning))