mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-09 07:14:48 +08:00
It was possible to get a NAME(x) result when calling call_of_name on x, which shouldn't happen. It should just return x.
17 lines
324 B
Python
17 lines
324 B
Python
from textwrap import dedent
|
|
|
|
from jedi import names
|
|
from jedi.evaluate import helpers
|
|
|
|
|
|
def test_call_of_name_in_brackets():
|
|
s = dedent("""
|
|
x = 1
|
|
type(x)
|
|
""")
|
|
last_x = names(s, references=True, definitions=False)[-1]
|
|
name = last_x._name
|
|
|
|
call = helpers.call_of_name(name)
|
|
assert call == name
|