diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-06 17:06:59 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-06 17:06:59 -0500 |
commit | 62699a318754c6811622d31cfab195b4dbc3775e (patch) | |
tree | 43771e501b7e5d8c4d9147517c46234726e1fc54 /tests/test_plugins.py | |
parent | 62a47468147c97379ea106b3f9c994445b4a08a4 (diff) | |
download | python-coveragepy-git-62699a318754c6811622d31cfab195b4dbc3775e.tar.gz |
A new kind of plug-in: configurers. #563
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r-- | tests/test_plugins.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 4dfe0bde..c4fc3ac7 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) |