mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-42864: Improve error messages regarding unclosed parentheses (GH-24161)
This commit is contained in:
parent
66f77caca3
commit
d6d6371447
8 changed files with 88 additions and 8 deletions
|
@ -987,6 +987,14 @@ def func2():
|
|||
self._check_error("A.\u03bc\\\n",
|
||||
"unexpected EOF while parsing")
|
||||
|
||||
def test_error_parenthesis(self):
|
||||
for paren in "([{":
|
||||
self._check_error(paren + "1 + 2", f"\\{paren}' was never closed")
|
||||
|
||||
for paren in ")]}":
|
||||
self._check_error(paren + "1 + 2", f"unmatched '\\{paren}'")
|
||||
|
||||
|
||||
def test_main():
|
||||
support.run_unittest(SyntaxTestCase)
|
||||
from test import test_syntax
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue