1
0
forked from VimPlug/jedi

Some test refactorings.

This commit is contained in:
Dave Halter
2016-12-03 14:32:00 +01:00
parent 69c23ac113
commit ee1f077014
7 changed files with 53 additions and 49 deletions

View File

@@ -5,7 +5,7 @@ from jedi import Script
def get_definition_and_evaluator(source):
d = Script(dedent(source)).goto_definitions()[0]
return d._name.parent, d._evaluator
return d._name.parent_context, d._evaluator
def test_function_execution():
@@ -22,8 +22,8 @@ def test_function_execution():
# Now just use the internals of the result (easiest way to get a fully
# usable function).
# Should return the same result both times.
assert len(evaluator.execute(func)) == 1
assert len(evaluator.execute(func)) == 1
assert len(func.execute_evaluated()) == 1
assert len(func.execute_evaluated()) == 1
def test_class_mro():
@@ -33,4 +33,4 @@ def test_class_mro():
X"""
cls, evaluator = get_definition_and_evaluator(s)
mro = cls.py__mro__()
assert [str(c.name) for c in mro] == ['X', 'object']
assert [c.name.string_name for c in mro] == ['X', 'object']