From 45cab8ccdd8577e3653ec80a3cb416fd9608f2ef Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Nov 2016 11:01:08 -0500 Subject: Add an additional test with a newline, one that's very similar to test_parens_in_expressions, but because the newline is not a literal newline, but a backslash en, this error is triggered. --- Lib/test/test_fstring.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 0af93e0..68aa526 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -378,6 +378,7 @@ f'{a * x()}'""" r"rf'{\t3}'", r"rf'{\}'", r"""rf'{"\N{LEFT CURLY BRACKET}"}'""", + r"f'{\n}'", ]) def test_no_escapes_for_braces(self): -- cgit v0.12 From da25abf7121d8fb330da51f9bca8847be05f56f8 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Nov 2016 11:14:48 -0500 Subject: Additionally show that a backslash-escaped opening brace is treated as a literal and thus triggers the single closing brace error, clarifying #28590. --- Lib/test/test_fstring.py | 1 + 1 file changed, 1 insertion(+) diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py index 68aa526..45f768c 100644 --- a/Lib/test/test_fstring.py +++ b/Lib/test/test_fstring.py @@ -628,6 +628,7 @@ f'{a * x()}'""" "f'}'", "f'x}'", "f'x}x'", + r"f'\u007b}'", # Can't have { or } in a format spec. "f'{3:}>10}'", -- cgit v0.12