Skip to content

Commit

Permalink
Add double quote cases to invalid prefix tests (GH-19489)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed Apr 13, 2020
1 parent da7933e commit 70c188e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Lib/test/test_fstring.py
Expand Up @@ -841,8 +841,7 @@ def test_nested_fstrings(self):
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''",
Expand All @@ -863,8 +862,10 @@ def test_invalid_string_prefixes(self):
"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')
Expand Down

0 comments on commit 70c188e

Please sign in to comment.