summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_collector.py5
-rw-r--r--tests/test_debug.py3
-rw-r--r--tests/test_plugins.py9
3 files changed, 11 insertions, 6 deletions
diff --git a/tests/test_collector.py b/tests/test_collector.py
index 7bd4beb..5f93138 100644
--- a/tests/test_collector.py
+++ b/tests/test_collector.py
@@ -37,9 +37,8 @@ class CollectorTest(CoverageTest):
# Trace one file, but not the other, and get the debug output.
debug_out = StringIO()
- cov = coverage.coverage(
- include=["f1.py"], debug=['trace'], debug_file=debug_out
- )
+ cov = coverage.coverage(include=["f1.py"], debug=['trace'])
+ cov._debug_file = debug_out
# Import the python file, executing it.
self.start_import_stop(cov, "f2")
diff --git a/tests/test_debug.py b/tests/test_debug.py
index 985da40..e8a8e95 100644
--- a/tests/test_debug.py
+++ b/tests/test_debug.py
@@ -47,7 +47,8 @@ class DebugTraceTest(CoverageTest):
""")
debug_out = StringIO()
- cov = coverage.coverage(debug=debug, debug_file=debug_out)
+ cov = coverage.coverage(debug=debug)
+ cov._debug_file = debug_out
self.start_import_stop(cov, "f1")
out_lines = debug_out.getvalue().splitlines()
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index 1f175f2..1bd2067 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -101,7 +101,9 @@ class PluginTest(CoverageTest):
""")
self.assert_doesnt_exist("evidence.out")
- _ = coverage.Coverage(plugins=["my_plugin"])
+ cov = coverage.Coverage(plugins=["my_plugin"])
+ cov.start()
+ cov.stop()
with open("evidence.out") as f:
self.assertEqual(f.read(), "we are here!")
@@ -111,6 +113,7 @@ class PluginTest(CoverageTest):
with self.assertRaises(ImportError):
cov = coverage.Coverage(plugins=["does_not_exist_woijwoicweo"])
cov.start()
+ cov.stop()
def test_bad_plugin_isnt_hidden(self):
# Prove that a plugin with an error in it will raise the error.
@@ -118,7 +121,9 @@ class PluginTest(CoverageTest):
1/0
""")
with self.assertRaises(ZeroDivisionError):
- _ = coverage.Coverage(plugins=["plugin_over_zero"])
+ cov = coverage.Coverage(plugins=["plugin_over_zero"])
+ cov.start()
+ cov.stop()
def test_importing_myself(self):
if sys.platform == 'win32':