mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-22 21:31:26 +08:00
Fix names selection and params, fixes #1283
This commit is contained in:
@@ -101,3 +101,20 @@ def test_names_twice(environment):
|
||||
def test_simple_name(environment):
|
||||
defs = names('foo', references=True, environment=environment)
|
||||
assert not defs[0]._name.infer()
|
||||
|
||||
|
||||
def test_no_error(environment):
|
||||
code = dedent("""
|
||||
def foo(a, b):
|
||||
if a == 10:
|
||||
if b is None:
|
||||
print("foo")
|
||||
a = 20
|
||||
""")
|
||||
func_name, = names(code)
|
||||
print(func_name.defined_names())
|
||||
a, b, a20 = func_name.defined_names()
|
||||
assert a.name == 'a'
|
||||
assert b.name == 'b'
|
||||
assert a20.name == 'a'
|
||||
assert a20.goto_assignments() == [a20]
|
||||
|
||||
Reference in New Issue
Block a user