Script.goto_assignments now always needs a call_path. Otherwise it raises a NotFoundError.

This change makes Jedi's behavior more consistent.
This commit is contained in:
Dave Halter
2014-09-04 00:56:58 +02:00
parent fb10199f37
commit e872d9e073
3 changed files with 20 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ Test of keywords and ``jedi.keywords``
"""
import jedi
from jedi import Script, common
import pytest
def test_goto_assignments_keyword():
@@ -19,8 +20,9 @@ def test_keyword():
defs = Script("print").goto_definitions()
assert [d.doc for d in defs]
defs = Script("import").goto_assignments()
assert len(defs) == 0
with pytest.raises(jedi.NotFoundError):
Script("import").goto_assignments()
completions = Script("import", 1, 1).completions()
assert len(completions) == 0
with common.ignored(jedi.NotFoundError): # TODO shouldn't throw that.