1
0
forked from VimPlug/jedi

Fix issues with the current branch

This commit is contained in:
Dave Halter
2018-08-09 23:25:29 +02:00
parent 62842c8ac1
commit b3a07941bb
3 changed files with 7 additions and 4 deletions

View File

@@ -431,7 +431,7 @@ def _is_annotation_name(name):
c = ancestor.children c = ancestor.children
if len(c) > 1 and c[1].type == 'annassign': if len(c) > 1 and c[1].type == 'annassign':
return c[1].start_pos <= name.start_pos < c[1].end_pos return c[1].start_pos <= name.start_pos < c[1].end_pos
return True return False
def _is_tuple(context): def _is_tuple(context):

View File

@@ -2,12 +2,13 @@ from textwrap import dedent
from jedi.evaluate import compiled from jedi.evaluate import compiled
from jedi.evaluate.context import instance from jedi.evaluate.context import instance
from jedi.evaluate.helpers import execute_evaluated
def test_simple(evaluator): def test_simple(evaluator):
obj = compiled.create_simple_object(evaluator, u'_str_') obj = compiled.create_simple_object(evaluator, u'_str_')
upper, = obj.py__getattribute__(u'upper') upper, = obj.py__getattribute__(u'upper')
objs = list(upper.execute_evaluated()) objs = list(execute_evaluated(upper))
assert len(objs) == 1 assert len(objs) == 1
assert isinstance(objs[0], instance.CompiledInstance) assert isinstance(objs[0], instance.CompiledInstance)

View File

@@ -1,5 +1,7 @@
from textwrap import dedent from textwrap import dedent
from jedi.evaluate.helpers import execute_evaluated
def get_definition_and_evaluator(Script, source): def get_definition_and_evaluator(Script, source):
first, = Script(dedent(source)).goto_definitions() first, = Script(dedent(source)).goto_definitions()
@@ -20,8 +22,8 @@ def test_function_execution(Script):
# Now just use the internals of the result (easiest way to get a fully # Now just use the internals of the result (easiest way to get a fully
# usable function). # usable function).
# Should return the same result both times. # Should return the same result both times.
assert len(func.execute_evaluated()) == 1 assert len(execute_evaluated(func)) == 1
assert len(func.execute_evaluated()) == 1 assert len(execute_evaluated(func)) == 1
def test_class_mro(Script): def test_class_mro(Script):