summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_syntax.py
diff options
context:
space:
mode:
authorNikita Sobolev <mail@sobolevn.me>2024-04-23 12:00:52 (GMT)
committerGitHub <noreply@github.com>2024-04-23 12:00:52 (GMT)
commitde1f6868270d31f56c388ef416daacd35feb152d (patch)
tree65b30c6d5b2cd0d8acf75fc9150decac082c0852 /Lib/test/test_syntax.py
parenteb927e9fc823de9539fcb82c9ea9d055462eb04a (diff)
downloadcpython-de1f6868270d31f56c388ef416daacd35feb152d.zip
cpython-de1f6868270d31f56c388ef416daacd35feb152d.tar.gz
cpython-de1f6868270d31f56c388ef416daacd35feb152d.tar.bz2
gh-118082: Improve `import` without names syntax error message (#118083)
Diffstat (limited to 'Lib/test/test_syntax.py')
-rw-r--r--Lib/test/test_syntax.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_syntax.py b/Lib/test/test_syntax.py
index dfa2a3b..e9bec33 100644
--- a/Lib/test/test_syntax.py
+++ b/Lib/test/test_syntax.py
@@ -1699,6 +1699,18 @@ SyntaxError: Did you mean to use 'from ... import ...' instead?
Traceback (most recent call last):
SyntaxError: invalid syntax
+>>> from i import
+Traceback (most recent call last):
+SyntaxError: Expected one or more names after 'import'
+
+>>> from .. import
+Traceback (most recent call last):
+SyntaxError: Expected one or more names after 'import'
+
+>>> import
+Traceback (most recent call last):
+SyntaxError: Expected one or more names after 'import'
+
>>> (): int
Traceback (most recent call last):
SyntaxError: only single target (not tuple) can be annotated