forked from VimPlug/jedi
Don't use goto_definitions anymore, use infer
This commit is contained in:
@@ -42,7 +42,7 @@ def test_namedtuple_content(Script):
|
||||
""")
|
||||
|
||||
def d(source):
|
||||
x, = Script(source).goto_definitions()
|
||||
x, = Script(source).infer()
|
||||
return x.name
|
||||
|
||||
assert d(source + 'unnamed.bar') == 'int'
|
||||
@@ -65,7 +65,7 @@ def test_nested_namedtuples(Script):
|
||||
assert 'data' in [c.name for c in s.complete()]
|
||||
|
||||
|
||||
def test_namedtuple_goto_definitions(Script):
|
||||
def test_namedtuple_infer(Script):
|
||||
source = dedent("""
|
||||
from collections import namedtuple
|
||||
|
||||
@@ -74,7 +74,7 @@ def test_namedtuple_goto_definitions(Script):
|
||||
|
||||
from jedi.api import Script
|
||||
|
||||
d1, = Script(source).goto_definitions()
|
||||
d1, = Script(source).infer()
|
||||
|
||||
assert d1.get_line_code() == "class Foo(tuple):\n"
|
||||
assert d1.module_path is None
|
||||
@@ -86,7 +86,7 @@ def test_re_sub(Script, environment):
|
||||
version differences.
|
||||
"""
|
||||
def run(code):
|
||||
defs = Script(code).goto_definitions()
|
||||
defs = Script(code).infer()
|
||||
return {d.name for d in defs}
|
||||
|
||||
names = run("import re; re.sub('a', 'a', 'f')")
|
||||
|
||||
Reference in New Issue
Block a user