1
0
forked from VimPlug/jedi

Avoid import recursions in other ways

This commit is contained in:
Dave Halter
2019-08-24 01:20:37 +02:00
parent 250ac77f4a
commit 6d361e03ac
4 changed files with 9 additions and 19 deletions

View File

@@ -219,15 +219,16 @@ def test_goto_assignments_follow_imports(Script):
def test_goto_module(Script):
def check(line, expected):
def check(line, expected, follow_imports=False):
script = Script(path=path, line=line)
module, = script.goto_assignments()
module, = script.goto_assignments(follow_imports=follow_imports)
assert module.module_path == expected
base_path = os.path.join(os.path.dirname(__file__), 'simple_import')
path = os.path.join(base_path, '__init__.py')
check(1, os.path.join(base_path, 'module.py'))
check(1, os.path.join(base_path, 'module.py'), follow_imports=True)
check(5, os.path.join(base_path, 'module2.py'))