mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 15:24:46 +08:00
user_statement problems with imports and brackets, test for #285
This commit is contained in:
13
test/test_parsing.py
Normal file
13
test/test_parsing.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from jedi import parsing
|
||||
from jedi import parsing_representation as pr
|
||||
|
||||
def test_user_statement_on_import():
|
||||
"""github #285"""
|
||||
s = "from datetime import (\n" \
|
||||
" time)"
|
||||
|
||||
for pos in [(2, 1), (2, 4)]:
|
||||
u = parsing.Parser(s, user_position=pos).user_stmt
|
||||
assert isinstance(u, pr.Import)
|
||||
assert u.defunct == False
|
||||
assert [str(n) for n in u.get_defined_names()] == ['time']
|
||||
Reference in New Issue
Block a user