summaryrefslogtreecommitdiff
path: root/tests/test_api.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 /tests/test_api.py
parentd3e55fd68d21d9629338edb5ee54222343172380 (diff)
downloadpython-coveragepy-git-aeaaa1ff0cc7c7c9674a9379e6388d6f0a950f3a.tar.gz
Restore Reporter.file_reporters, with a deprecation warning.
Diffstat (limited to 'tests/test_api.py')
-rw-r--r--tests/test_api.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_api.py b/tests/test_api.py
index f849695c..55cdbe8d 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -7,11 +7,13 @@ import fnmatch
import os
import sys
import textwrap
+import warnings
import coverage
from coverage import env
from coverage.backward import StringIO
from coverage.misc import CoverageException
+from coverage.report import Reporter
from tests.coveragetest import CoverageTest
@@ -560,3 +562,17 @@ class TestRunnerPluginTest(CoverageTest):
def test_nose_plugin_with_erase(self):
self.pretend_to_be_nose_with_cover(erase=True)
+
+
+class ReporterDeprecatedAttributeTest(CoverageTest):
+ """Test that Reporter.file_reporters has been deprecated."""
+
+ run_in_temp_dir = False
+
+ def test_reporter_file_reporters(self):
+ rep = Reporter(None, None)
+ with warnings.catch_warnings(record=True) as warns:
+ warnings.simplefilter("always")
+ rep.file_reporters
+ self.assertEqual(len(warns), 1)
+ self.assertTrue(issubclass(warns[0].category, DeprecationWarning))