summaryrefslogtreecommitdiff
path: root/tests/test_plugins.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-12-31 16:38:02 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-12-31 16:38:02 -0500
commit0bcb2cb8344eb4cec24455fa421ece185eec0fac (patch)
tree4d6ed7c2be8689c39b7ac949905c4883392d3a0b /tests/test_plugins.py
parentbf73b37080c3c6deec969a555b45b70ee6727b13 (diff)
downloadpython-coveragepy-git-0bcb2cb8344eb4cec24455fa421ece185eec0fac.tar.gz
test: a sorted_lines helper
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r--tests/test_plugins.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index cd446441..d407f748 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -14,7 +14,7 @@ import pytest
import coverage
from coverage import env
from coverage.control import Plugins
-from coverage.data import line_counts
+from coverage.data import line_counts, sorted_lines
from coverage.exceptions import CoverageWarning, NoSource, PluginError
from coverage.misc import import_local_file
@@ -1047,11 +1047,11 @@ class DynamicContextPluginTest(CoverageTest):
expected = ['', 'doctest:HTML_TAG', 'test:HTML_TAG', 'test:RENDERERS']
assert expected == sorted(data.measured_contexts())
data.set_query_context("doctest:HTML_TAG")
- assert [2] == data.lines(filenames['rendering.py'])
+ assert [2] == sorted_lines(data, filenames['rendering.py'])
data.set_query_context("test:HTML_TAG")
- assert [2] == data.lines(filenames['rendering.py'])
+ assert [2] == sorted_lines(data, filenames['rendering.py'])
data.set_query_context("test:RENDERERS")
- assert [2, 5, 8, 11] == sorted(data.lines(filenames['rendering.py']))
+ assert [2, 5, 8, 11] == sorted_lines(data, filenames['rendering.py'])
def test_static_context(self):
self.make_plugin_capitalized_testnames('plugin_tests.py')
@@ -1101,7 +1101,7 @@ class DynamicContextPluginTest(CoverageTest):
def assert_context_lines(context, lines):
data.set_query_context(context)
- assert lines == sorted(data.lines(filenames['rendering.py']))
+ assert lines == sorted_lines(data, filenames['rendering.py'])
assert_context_lines("doctest:HTML_TAG", [2])
assert_context_lines("testsuite.test_html_tag", [2])
@@ -1139,7 +1139,7 @@ class DynamicContextPluginTest(CoverageTest):
def assert_context_lines(context, lines):
data.set_query_context(context)
- assert lines == sorted(data.lines(filenames['rendering.py']))
+ assert lines == sorted_lines(data, filenames['rendering.py'])
assert_context_lines("test:HTML_TAG", [2])
assert_context_lines("test:RENDERERS", [2, 5, 8, 11])