summaryrefslogtreecommitdiff
path: root/tests/test_plugins.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r--tests/test_plugins.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index 06e3788d..54f26a7f 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -255,17 +255,11 @@ class PluginWarningOnPyTracer(CoverageTest):
cov = coverage.Coverage()
cov.set_option("run:plugins", ["tests.plugin1"])
- warnings = []
- def capture_warning(msg):
- """A fake implementation of Coverage._warn, to capture warnings."""
- warnings.append(msg)
- cov._warn = capture_warning
-
- self.start_import_stop(cov, "simple")
- self.assertIn(
- "Plugin file tracers (tests.plugin1.Plugin) aren't supported with PyTracer",
- warnings
- )
+ expected_warnings = [
+ r"Plugin file tracers \(tests.plugin1.Plugin\) aren't supported with PyTracer",
+ ]
+ with self.assert_warnings(cov, expected_warnings):
+ self.start_import_stop(cov, "simple")
class FileTracerTest(CoverageTest):