summaryrefslogtreecommitdiff
path: root/tests/test_plugins.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r--tests/test_plugins.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index 27227c33..b1614832 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -1,5 +1,5 @@
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
-# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests for plugins."""
@@ -8,6 +8,7 @@ import os.path
import coverage
from coverage import env
from coverage.backward import StringIO
+from coverage.data import line_counts
from coverage.control import Plugins
from coverage.misc import CoverageException
@@ -189,7 +190,8 @@ class PluginTest(CoverageTest):
cov = coverage.Coverage(debug=["sys"])
cov._debug_file = debug_out
cov.set_option("run:plugins", ["plugin_sys_info"])
- cov.load()
+ cov.start()
+ cov.stop()
out_lines = [line.strip() for line in debug_out.getvalue().splitlines()]
if env.C_TRACER:
@@ -218,7 +220,8 @@ class PluginTest(CoverageTest):
cov = coverage.Coverage(debug=["sys"])
cov._debug_file = debug_out
cov.set_option("run:plugins", ["plugin_no_sys_info"])
- cov.load()
+ cov.start()
+ cov.stop()
out_lines = [line.strip() for line in debug_out.getvalue().splitlines()]
self.assertIn('plugins.file_tracers: -none-', out_lines)
@@ -369,19 +372,19 @@ class GoodFileTracerTest(FileTracerTest):
_, statements, missing, _ = cov.analysis("foo_7.html")
self.assertEqual(statements, [1, 2, 3, 4, 5, 6, 7])
self.assertEqual(missing, [1, 2, 3, 6, 7])
- self.assertIn("foo_7.html", cov.data.line_counts())
+ self.assertIn("foo_7.html", line_counts(cov.get_data()))
_, statements, missing, _ = cov.analysis("bar_4.html")
self.assertEqual(statements, [1, 2, 3, 4])
self.assertEqual(missing, [1, 4])
- self.assertIn("bar_4.html", cov.data.line_counts())
+ self.assertIn("bar_4.html", line_counts(cov.get_data()))
- self.assertNotIn("quux_5.html", cov.data.line_counts())
+ self.assertNotIn("quux_5.html", line_counts(cov.get_data()))
_, statements, missing, _ = cov.analysis("uni_3.html")
self.assertEqual(statements, [1, 2, 3])
self.assertEqual(missing, [1])
- self.assertIn("uni_3.html", cov.data.line_counts())
+ self.assertIn("uni_3.html", line_counts(cov.get_data()))
def test_plugin2_with_branch(self):
self.make_render_and_caller()
@@ -860,8 +863,6 @@ class BadFileTracerTest(FileTracerTest):
class ConfigurerPluginTest(CoverageTest):
"""Test configuring plugins."""
- run_in_temp_dir = False
-
def test_configurer_plugin(self):
cov = coverage.Coverage()
cov.set_option("run:plugins", ["tests.plugin_config"])