summaryrefslogtreecommitdiff
path: root/tests/test_plugins.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-07-06 11:18:05 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-07-06 11:18:05 -0400
commit2f8ac13ff412805e770c9af704b9de3fb95c61c7 (patch)
tree39c52e235b2119ebde91b5d265826b2a030a8521 /tests/test_plugins.py
parentf310f22a92c88cd3984e2bedf80be802cd0818d2 (diff)
downloadpython-coveragepy-git-2f8ac13ff412805e770c9af704b9de3fb95c61c7.tar.gz
Add a test about claiming a plugin is a file tracer, when it is not.
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r--tests/test_plugins.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index 798e04ab..2f58eceb 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -471,6 +471,9 @@ class BadPluginTest(FileTracerTest):
`our_error` is True if the error reported to the user will be an
explicit error in our test code, marked with an # Oh noes! comment.
+ The plugin will be disabled, and we check that a warning is output
+ explaining why.
+
"""
self.make_file("simple.py", """\
import other, another
@@ -511,6 +514,16 @@ class BadPluginTest(FileTracerTest):
warnings = stderr.count(msg)
self.assertEqual(warnings, 1)
+ def test_file_tracer_has_no_file_tracer_method(self):
+ self.make_file("bad_plugin.py", """\
+ class Plugin(object):
+ pass
+
+ def coverage_init(reg, options):
+ reg.add_file_tracer(Plugin())
+ """)
+ self.run_bad_plugin("bad_plugin", "Plugin", our_error=False)
+
def test_file_tracer_fails(self):
self.make_file("bad_plugin.py", """\
import coverage.plugin