Skip to content

Commit

Permalink
Add failing test case for escaped curly braces bug in UP032
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Nov 15, 2023
1 parent a783b14 commit 53febeb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/ruff_linter/resources/test/fixtures/pyupgrade/UP032_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,17 @@ async def c():
# The fixed string will exceed the line length, but it's still smaller than the
# existing line length, so it's fine.
"<Customer: {}, {}, {}, {}, {}>".format(self.internal_ids, self.external_ids, self.properties, self.tags, self.others)


# The first string will be converted to an f-string and the curly braces in the second should be converted to be unescaped
(
"{}"
"{{}}"
).format(a)


# Both strings will be converted to an f-string and the curly braces in the second should left escaped
(
"{}"
"{{{}}}"
).format(a, b)

0 comments on commit 53febeb

Please sign in to comment.