summaryrefslogtreecommitdiff
path: root/tests/test_phystokens.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-10-28 06:59:03 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-10-28 06:59:03 -0400
commit81a55d102550b4535191756960f6846083fc7e30 (patch)
tree0f61064078496ac483e5d03b23800e2f1b95513a /tests/test_phystokens.py
parente36475a387b734711fbbe84c0fe4b6d0777cd9ec (diff)
downloadpython-coveragepy-git-81a55d102550b4535191756960f6846083fc7e30.tar.gz
refactor(test): make re_lines (et al) look like re.search
and also replace some calls with just-plain re.search.
Diffstat (limited to 'tests/test_phystokens.py')
-rw-r--r--tests/test_phystokens.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py
index fea581a5..f3985437 100644
--- a/tests/test_phystokens.py
+++ b/tests/test_phystokens.py
@@ -15,7 +15,6 @@ from coverage.phystokens import neuter_encoding_declaration, compile_unicode
from coverage.python import get_python_source
from tests.coveragetest import CoverageTest, TESTS_DIR
-from tests.helpers import re_lines
# A simple program and its token stream.
@@ -102,11 +101,11 @@ class PhysTokensTest(CoverageTest):
stress = os.path.join(TESTS_DIR, "stress_phystoken.tok")
self.check_file_tokenization(stress)
with open(stress) as fstress:
- assert re_lines(fstress.read(), r"\s$"), f"{stress} needs a trailing space."
+ assert re.search(r"\s$", fstress.read()), f"{stress} needs a trailing space."
stress = os.path.join(TESTS_DIR, "stress_phystoken_dos.tok")
self.check_file_tokenization(stress)
with open(stress) as fstress:
- assert re_lines(fstress.read(), r"\s$"), f"{stress} needs a trailing space."
+ assert re.search(r"\s$", fstress.read()), f"{stress} needs a trailing space."
@pytest.mark.skipif(not env.PYBEHAVIOR.soft_keywords, reason="Soft keywords are new in Python 3.10")