diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_plugins.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 813d370e..128b7b07 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -253,6 +253,36 @@ class PluginTest(CoverageTest): out = self.run_command("coverage html") self.assertEqual(out, "") + def test_omitted_traced_plugin_deps_dont_warn(self): + self.make_file("traces_own_deps_plugin.py", """\ + from coverage import CoveragePlugin + import local_module + class MyPlugin(CoveragePlugin): + def file_tracer(self, filename): + if 'local_module' in filename: + return self + return None + + def coverage_init(reg, options): + reg.add_noop(MyPlugin()) + """) + self.make_file("local_module.py", "CONST = 1") + self.make_file(".coveragerc", """\ + [run] + plugins = traces_own_deps_plugin + omit=local_module.py,traces_own_deps_plugin.py + source=. + """) + self.make_file("main_file.py", """\ + import local_module + print('MAIN') + """) + + out = self.run_command("coverage run main_file.py") + self.assertEqual(out, "MAIN\n") + out = self.run_command("coverage html") + self.assertEqual(out, "") + class PluginWarningOnPyTracer(CoverageTest): """Test that we get a controlled exception with plugins on PyTracer.""" |