summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_misc.py15
-rw-r--r--tests/test_results.py15
2 files changed, 15 insertions, 15 deletions
diff --git a/tests/test_misc.py b/tests/test_misc.py
index c8c2c9e4..e288c4f2 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -6,7 +6,7 @@
import pytest
from coverage.misc import contract, dummy_decorator_with_args, file_be_gone
-from coverage.misc import format_lines, Hasher, one_of, substitute_variables
+from coverage.misc import Hasher, one_of, substitute_variables
from coverage.misc import CoverageException
from tests.coveragetest import CoverageTest
@@ -125,19 +125,6 @@ class ContractTest(CoverageTest):
assert undecorated(b=42, a=3) == (3, 42)
-@pytest.mark.parametrize("statements, lines, result", [
- (set([1,2,3,4,5,10,11,12,13,14]), set([1,2,5,10,11,13,14]), "1-2, 5-11, 13-14"),
- ([1,2,3,4,5,10,11,12,13,14,98,99], [1,2,5,10,11,13,14,99], "1-2, 5-11, 13-14, 99"),
- ([1,2,3,4,98,99,100,101,102,103,104], [1,2,99,102,103,104], "1-2, 99, 102-104"),
- ([17], [17], "17"),
- ([90,91,92,93,94,95], [90,91,92,93,94,95], "90-95"),
- ([1, 2, 3, 4, 5], [], ""),
- ([1, 2, 3, 4, 5], [4], "4"),
-])
-def test_format_lines(statements, lines, result):
- assert format_lines(statements, lines) == result
-
-
VARS = {
'FOO': 'fooey',
'BAR': 'xyzzy',
diff --git a/tests/test_results.py b/tests/test_results.py
index ec6301db..8acbcaec 100644
--- a/tests/test_results.py
+++ b/tests/test_results.py
@@ -6,7 +6,7 @@
import pytest
from coverage.misc import CoverageException
-from coverage.results import Numbers, should_fail_under
+from coverage.results import format_lines, Numbers, should_fail_under
from tests.coveragetest import CoverageTest
@@ -111,3 +111,16 @@ def test_should_fail_under(total, fail_under, precision, result):
def test_should_fail_under_invalid_value():
with pytest.raises(CoverageException, match=r"fail_under=101"):
should_fail_under(100.0, 101, 0)
+
+
+@pytest.mark.parametrize("statements, lines, result", [
+ (set([1,2,3,4,5,10,11,12,13,14]), set([1,2,5,10,11,13,14]), "1-2, 5-11, 13-14"),
+ ([1,2,3,4,5,10,11,12,13,14,98,99], [1,2,5,10,11,13,14,99], "1-2, 5-11, 13-14, 99"),
+ ([1,2,3,4,98,99,100,101,102,103,104], [1,2,99,102,103,104], "1-2, 99, 102-104"),
+ ([17], [17], "17"),
+ ([90,91,92,93,94,95], [90,91,92,93,94,95], "90-95"),
+ ([1, 2, 3, 4, 5], [], ""),
+ ([1, 2, 3, 4, 5], [4], "4"),
+])
+def test_format_lines(statements, lines, result):
+ assert format_lines(statements, lines) == result