Fix a bug in call_of_name.

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.
This commit is contained in:
Dave Halter
2015-06-29 11:27:10 +02:00
parent 5d9fff50af
commit a014d4fd38
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
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