mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-33306: Improve SyntaxError messages for unbalanced parentheses. (GH-6516)
This commit is contained in:
parent
bdabb0737c
commit
94cf308ee2
5 changed files with 47 additions and 7 deletions
|
@ -1004,10 +1004,14 @@ non-important content
|
|||
self.assertEqual('{d[0]}'.format(d=d), 'integer')
|
||||
|
||||
def test_invalid_expressions(self):
|
||||
self.assertAllRaise(SyntaxError, 'invalid syntax',
|
||||
[r"f'{a[4)}'",
|
||||
r"f'{a(4]}'",
|
||||
])
|
||||
self.assertAllRaise(SyntaxError,
|
||||
r"closing parenthesis '\)' does not match "
|
||||
r"opening parenthesis '\[' \(<fstring>, line 1\)",
|
||||
[r"f'{a[4)}'"])
|
||||
self.assertAllRaise(SyntaxError,
|
||||
r"closing parenthesis '\]' does not match "
|
||||
r"opening parenthesis '\(' \(<fstring>, line 1\)",
|
||||
[r"f'{a(4]}'"])
|
||||
|
||||
def test_errors(self):
|
||||
# see issue 26287
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue