diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-12-09 12:24:12 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-12-12 15:36:37 -0500 |
commit | b8a2153e8711d0275f71e9e66e566d49750e8360 (patch) | |
tree | 917f481f91866864156cd3cb53d1c03e7e8706cb /tests/test_plugins.py | |
parent | 03d9059877ffe148966e2c0022b3275eb6c02cfd (diff) | |
download | python-coveragepy-git-nedbat/pytest-7.tar.gz |
refactor(test): a context manager to swallow warningsnedbat/pytest-7
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r-- | tests/test_plugins.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 2140f00c..d50ff6d2 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -20,7 +20,7 @@ from coverage.misc import import_local_file import coverage.plugin from tests.coveragetest import CoverageTest -from tests.helpers import CheckUniqueFilenames +from tests.helpers import CheckUniqueFilenames, swallow_warnings class FakeConfig: @@ -193,8 +193,9 @@ class PluginTest(CoverageTest): cov = coverage.Coverage(debug=["sys"]) cov._debug_file = debug_out cov.set_option("run:plugins", ["plugin_sys_info"]) - with pytest.warns(None): - # Catch warnings so we don't see "plugins aren't supported on PyTracer" + with swallow_warnings( + r"Plugin file tracers \(plugin_sys_info.Plugin\) aren't supported with PyTracer" + ): cov.start() cov.stop() # pragma: nested |