Add double quote cases to invalid prefix tests (GH-19489)

This commit is contained in:
Pablo Galindo 2020-04-13 02:47:35 +01:00 committed by GitHub
parent da7933ecc3
commit 70c188eee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -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')