1
0
forked from VimPlug/jedi

Don't use goto_definitions anymore, use infer

This commit is contained in:
Dave Halter
2019-12-20 19:02:18 +01:00
parent 4bbaec68e8
commit d7d9c9642a
30 changed files with 131 additions and 137 deletions

View File

@@ -29,7 +29,7 @@ def test_if(Script):
# Two parsers needed, one for pass and one for the function.
check_p(src)
assert [d.name for d in Script(src, 8, 6).goto_definitions()] == ['int']
assert [d.name for d in Script(src).infer(8, 6)] == ['int']
def test_class_and_if(Script):
@@ -47,7 +47,7 @@ def test_class_and_if(Script):
# COMMENT
a_func()""")
check_p(src)
assert [d.name for d in Script(src).goto_definitions()] == ['int']
assert [d.name for d in Script(src).infer()] == ['int']
def test_add_to_end(Script):
@@ -82,7 +82,7 @@ def test_add_to_end(Script):
def test_tokenizer_with_string_literal_backslash(Script):
c = Script("statement = u'foo\\\n'; statement").goto_definitions()
c = Script("statement = u'foo\\\n'; statement").infer()
assert c[0]._name._value.get_safe_value() == 'foo'
@@ -90,6 +90,6 @@ def test_ellipsis_without_getitem(Script, environment):
if environment.version_info.major == 2:
pytest.skip('In 2.7 Ellipsis can only be used like x[...]')
def_, = Script('x=...;x').goto_definitions()
def_, = Script('x=...;x').infer()
assert def_.name == 'ellipsis'