summaryrefslogtreecommitdiff
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-01-19 23:59:33 +0000
committerGitHub <noreply@github.com>2021-01-19 23:59:33 +0000
commitd6d6371447357c9c69b093657bbbb3977a3e60f2 (patch)
treea7676cfcf08746f0ca890f3b7d820a379e58f310 /Lib/test/test_syntax.py
parent66f77caca39ba39ebe1e4a95dba6d19b20d51951 (diff)
downloadcpython-git-d6d6371447357c9c69b093657bbbb3977a3e60f2.tar.gz
bpo-42864: Improve error messages regarding unclosed parentheses (GH-24161)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index d8255607dc..c8d191df4c 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -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