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 | db260dc3feb931947309e88fa93063a0a37b6eda (patch) | |
| tree | 50867f9cd23e2c6196f145eca32e39cd0ffdbe19 /tests/test_plugins.py | |
| parent | 66dc96690399b6db97c638fefa8dcff626844900 (diff) | |
| download | python-coveragepy-db260dc3feb931947309e88fa93063a0a37b6eda.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 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) |
