From 30f72c48c4b3460f1d7c9b7f8d0f0b5672ad8b00 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 1 Mar 2020 20:11:00 +0100 Subject: [PATCH] Test that full_name in funcs work --- test/test_api/test_full_name.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/test_api/test_full_name.py b/test/test_api/test_full_name.py index 5944ad72..3c287d1a 100644 --- a/test/test_api/test_full_name.py +++ b/test/test_api/test_full_name.py @@ -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'