forked from VimPlug/jedi
Use grammar in test scripts.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
from jedi._compatibility import builtins, is_py3
|
||||
from jedi.parser.representation import Function
|
||||
from jedi.parser import load_grammar
|
||||
from jedi.parser.tree import Function
|
||||
from jedi.evaluate import compiled, representation
|
||||
from jedi.evaluate import Evaluator
|
||||
from jedi import Script
|
||||
|
||||
|
||||
def test_simple():
|
||||
e = Evaluator()
|
||||
e = Evaluator(load_grammar())
|
||||
bltn = compiled.CompiledObject(builtins)
|
||||
obj = compiled.CompiledObject('_str_', bltn)
|
||||
upper = e.find_types(obj, 'upper')
|
||||
@@ -17,7 +18,7 @@ def test_simple():
|
||||
|
||||
|
||||
def test_fake_loading():
|
||||
assert isinstance(compiled.create(Evaluator(), next), Function)
|
||||
assert isinstance(compiled.create(Evaluator(load_grammar()), next), Function)
|
||||
|
||||
string = compiled.builtin.get_subscope_by_name('str')
|
||||
from_name = compiled._create_from_name(
|
||||
@@ -29,7 +30,7 @@ def test_fake_loading():
|
||||
|
||||
|
||||
def test_fake_docstr():
|
||||
assert compiled.create(Evaluator(), next).raw_doc == next.__doc__
|
||||
assert compiled.create(Evaluator(load_grammar()), next).raw_doc == next.__doc__
|
||||
|
||||
|
||||
def test_parse_function_doc_illegal_docstr():
|
||||
|
||||
Reference in New Issue
Block a user