summaryrefslogtreecommitdiff
path: root/tests/test_plugins.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-02-13 06:28:24 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-02-13 06:28:24 -0500
commitbfc62e94b9a7d5f4da34ec94298947f8e5527063 (patch)
treed5b5ff09c973ac138ae8cb08954291c01ed43ce8 /tests/test_plugins.py
parentaccf556d46062bf1dfeb00f1b46892c2a4b12e4b (diff)
downloadpython-coveragepy-bfc62e94b9a7d5f4da34ec94298947f8e5527063.tar.gz
Always make the current directory importable. #358
Diffstat (limited to 'tests/test_plugins.py')
-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 0d57bc9..9cbe23b 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."""