diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-27 08:51:43 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-10-27 09:12:30 -0400 |
| commit | 055a9f4b38aebdabc8cb80dcc40a5b29b8f71781 (patch) | |
| tree | 2ef5112132ccebdb9bb0e9553fddd8de8d20c93f /tests/test_phystokens.py | |
| parent | 15aff0ad7d6c92851bc21fc39863a3949edbb9c6 (diff) | |
| download | python-coveragepy-git-055a9f4b38aebdabc8cb80dcc40a5b29b8f71781.tar.gz | |
fix(debug): ast_dump failed on a few things
Diffstat (limited to 'tests/test_phystokens.py')
| -rw-r--r-- | tests/test_phystokens.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index 3c214c63..fea581a5 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -15,6 +15,7 @@ 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. @@ -97,10 +98,15 @@ class PhysTokensTest(CoverageTest): def test_stress(self): # Check the tokenization of a stress-test file. + # And check that those files haven't been incorrectly "fixed". 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." 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." @pytest.mark.skipif(not env.PYBEHAVIOR.soft_keywords, reason="Soft keywords are new in Python 3.10") |
