summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_plugins.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index 0d57bc97..9cbe23b9 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -198,6 +198,25 @@ class PluginTest(CoverageTest):
]
self.assertEqual(expected_end, out_lines[-len(expected_end):])
+ def test_local_files_are_importable(self):
+ self.make_file("importing_plugin.py", """\
+ from coverage import CoveragePlugin
+ import local_module
+ class Plugin(CoveragePlugin):
+ pass
+ """)
+ self.make_file("local_module.py", "CONST = 1")
+ self.make_file(".coveragerc", """\
+ [run]
+ plugins = importing_plugin
+ """)
+ self.make_file("main_file.py", "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."""