summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-04-13 01:47:35 (GMT)
committerGitHub <noreply@github.com>2020-04-13 01:47:35 (GMT)
commit70c188eee019778583f19886e3b620d17bc86cd8 (patch)
treed45b1776eb352ad1042d628886ad2ef4879d0396 /Lib
parentda7933ecc30e37b119756cb02b89a6ad99db22e0 (diff)
downloadcpython-70c188eee019778583f19886e3b620d17bc86cd8.zip
cpython-70c188eee019778583f19886e3b620d17bc86cd8.tar.gz
cpython-70c188eee019778583f19886e3b620d17bc86cd8.tar.bz2
Add double quote cases to invalid prefix tests (GH-19489)
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_fstring.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index ef0ccb8..8fd7cf0 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -841,8 +841,7 @@ non-important content
self.assertEqual(f'{f"{y}"*3}', '555')
def test_invalid_string_prefixes(self):
- self.assertAllRaise(SyntaxError, 'invalid string prefix',
- ["fu''",
+ single_quote_cases = ["fu''",
"uf''",
"Fu''",
"fU''",
@@ -863,8 +862,10 @@ non-important content
"bf''",
"bF''",
"Bf''",
- "BF''",
- ])
+ "BF''",]
+ double_quote_cases = [case.replace("'", '"') for case in single_quote_cases]
+ self.assertAllRaise(SyntaxError, 'invalid string prefix',
+ single_quote_cases + double_quote_cases)
def test_leading_trailing_spaces(self):
self.assertEqual(f'{ 3}', '3')