From db260dc3feb931947309e88fa93063a0a37b6eda Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 6 Jan 2018 17:06:59 -0500 Subject: A new kind of plug-in: configurers. #563 --- tests/test_plugins.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'tests/test_plugins.py') diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 4dfe0bd..c4fc3ac 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -621,10 +621,10 @@ class BadFileTracerTest(FileTracerTest): # There should be a warning explaining what's happening, but only one. # The message can be in two forms: - # Disabling plugin '...' due to previous exception + # Disabling plug-in '...' due to previous exception # or: - # Disabling plugin '...' due to an exception: - msg = "Disabling plugin '%s.%s' due to " % (module_name, plugin_name) + # Disabling plug-in '...' due to an exception: + msg = "Disabling plug-in '%s.%s' due to " % (module_name, plugin_name) warnings = stderr.count(msg) self.assertEqual(warnings, 1) @@ -848,3 +848,16 @@ class BadFileTracerTest(FileTracerTest): self.run_bad_plugin( "bad_plugin", "Plugin", our_error=False, excmsg="an integer is required", ) + + +class ConfigurerPluginTest(CoverageTest): + """Test configuring plugins.""" + + def test_configurer_plugin(self): + cov = coverage.Coverage() + cov.set_option("run:plugins", ["tests.plugin_config"]) + cov.start() + cov.stop() # pragma: nested + excluded = cov.get_option("report:exclude_lines") + self.assertIn("pragma: custom", excluded) + self.assertIn("pragma: or whatever", excluded) -- cgit v1.2.1