Skip to content

Commit

Permalink
Fix test_clean_source for python 3.13.2
Browse files Browse the repository at this point in the history
In python 3.13.2 untokenize() does not round-trip for code containing
line breaks (\ + \n). This patch removes the test case for the space
removal before line break.

python/cpython#125553
  • Loading branch information
danigm authored and Zac-HD committed Mar 2, 2025
1 parent a45ccf5 commit d8dec21
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hypothesis-python/tests/cover/test_reflection.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,10 @@ def test_param_called_within_defaults_on_error():

def _prep_source(*pairs):
return [
pytest.param(dedent(x).strip(), dedent(y).strip().encode(), id=f"case-{i}")
for i, (x, y) in enumerate(pairs)
pytest.param(
dedent(x).strip(), dedent(y).strip().encode(), id=f"case-{i}", marks=marks
)
for i, (x, y, *marks) in enumerate(pairs)
]


Expand Down Expand Up @@ -697,6 +699,10 @@ def \\
def\\
f(): pass
""",
pytest.mark.skipif(
sys.version_info[:3] == (3, 13, 2),
reason="untokenize() does not round-trip for code with line breaks, gh-125553",
),
),
(
"""
Expand Down

0 comments on commit d8dec21

Please sign in to comment.