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
commite93531e45438d632a55c570cdcaac7c93fe1814e (patch)
tree5a10794ccadd2520fdc9a16eb29ab9fa0e668fb4 /tests/test_plugins.py
parent26ec3086b6f6856392b1747afea2cc693351f13e (diff)
downloadpython-coveragepy-git-e93531e45438d632a55c570cdcaac7c93fe1814e.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 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."""