Test that full_name in funcs work

This commit is contained in:
Dave Halter
2020-03-01 20:11:00 +01:00
parent e03924895b
commit 30f72c48c4

View File

@@ -121,3 +121,10 @@ def test_param_name(Script):
name, = Script('class X:\n def foo(bar): bar''').goto()
assert name.type == 'param'
assert name.full_name is None
def test_variable_in_func(Script):
names = Script('def f(): x = 3').get_names(all_scopes=True)
x = names[-1]
assert x.name == 'x'
assert x.full_name == '__main__.f.x'