Skip to content

Commit

Permalink
make it pass on different python versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Aug 21, 2024
1 parent a11dacc commit 69261f6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/test_edits.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,17 @@ def test_mixed_quote_types(state: State):


def test_mixed_quote_types_unsafe(state: State):
"""Test that a multiline, mixed-quotes expression is transformed."""
"""Transforming an expression with quotes in it is more tricky.
Currently its transformed when running on python >= 3.12, otherwise not."""

expected = '''f"one is \\"{'\\"'.join(one)}\\" and two is {two}"'''

out, count = code_editor.fstringify_code_by_line(s_in_mixed_quotes_unsafe, state)
assert out == expected
if sys.version_info < (3, 12):
assert out == s_in_mixed_quotes_unsafe
else:
assert out == expected


def test_super_call(state: State):
Expand Down

0 comments on commit 69261f6

Please sign in to comment.