summaryrefslogtreecommitdiff
path: root/tests/test_testing.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-27 08:02:44 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-27 08:50:31 -0400
commit15aff0ad7d6c92851bc21fc39863a3949edbb9c6 (patch)
tree4c1bbef4e9e6d9d3f789fb3b52649c42100ccbf5 /tests/test_testing.py
parent93c9ca9f1b2e5d0b45dbf4b82c77aaf05b458bac (diff)
downloadpython-coveragepy-git-15aff0ad7d6c92851bc21fc39863a3949edbb9c6.tar.gz
refactor(test): re_lines is more useful if it returns a list
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r--tests/test_testing.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py
index 37130074..8d559fe4 100644
--- a/tests/test_testing.py
+++ b/tests/test_testing.py
@@ -19,7 +19,7 @@ from coverage.files import actual_path
from tests.coveragetest import CoverageTest
from tests.helpers import (
arcs_to_arcz_repr, arcz_to_arcs, assert_count_equal, assert_coverage_warnings,
- CheckUniqueFilenames, re_lines, re_line, without_module,
+ CheckUniqueFilenames, re_lines, re_lines_text, re_line, without_module,
)
@@ -302,7 +302,8 @@ class ReLinesTest(CoverageTest):
("line1\nline2\nline3\n", "X", ""),
])
def test_re_lines(self, text, pat, result):
- assert re_lines(text, pat) == result
+ assert re_lines_text(text, pat) == result
+ assert re_lines(text, pat) == result.splitlines()
@pytest.mark.parametrize("text, pat, result", [
("line1\nline2\nline3\n", "line", ""),
@@ -310,7 +311,8 @@ class ReLinesTest(CoverageTest):
("line1\nline2\nline3\n", "X", "line1\nline2\nline3\n"),
])
def test_re_lines_inverted(self, text, pat, result):
- assert re_lines(text, pat, match=False) == result
+ assert re_lines_text(text, pat, match=False) == result
+ assert re_lines(text, pat, match=False) == result.splitlines()
@pytest.mark.parametrize("text, pat, result", [
("line1\nline2\nline3\n", "2", "line2"),