From 53febeb334ee7360436404c63847bae99039b343 Mon Sep 17 00:00:00 2001 From: Zanie Date: Wed, 15 Nov 2023 10:01:13 -0600 Subject: [PATCH] Add failing test case for escaped curly braces bug in UP032 --- .../resources/test/fixtures/pyupgrade/UP032_0.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/ruff_linter/resources/test/fixtures/pyupgrade/UP032_0.py b/crates/ruff_linter/resources/test/fixtures/pyupgrade/UP032_0.py index 0ba30683b92ae7..6e8b7e8c728de1 100644 --- a/crates/ruff_linter/resources/test/fixtures/pyupgrade/UP032_0.py +++ b/crates/ruff_linter/resources/test/fixtures/pyupgrade/UP032_0.py @@ -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. "".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) \ No newline at end of file