mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-07 14:34:31 +08:00
Remove load_python_grammar for tests as well.
This commit is contained in:
@@ -133,7 +133,7 @@ TEST_ASSIGNMENTS = 2
|
|||||||
TEST_USAGES = 3
|
TEST_USAGES = 3
|
||||||
|
|
||||||
|
|
||||||
grammar36 = parso.load_python_grammar('3.6')
|
grammar36 = parso.load_grammar('3.6')
|
||||||
|
|
||||||
|
|
||||||
class IntegrationTestCase(object):
|
class IntegrationTestCase(object):
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import os
|
import os
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
|
import parso
|
||||||
|
|
||||||
from jedi._compatibility import u
|
from jedi._compatibility import u
|
||||||
from jedi.evaluate.sys_path import (_get_parent_dir_with_file,
|
from jedi.evaluate.sys_path import (_get_parent_dir_with_file,
|
||||||
_get_buildout_script_paths,
|
_get_buildout_script_paths,
|
||||||
@@ -8,15 +10,13 @@ from jedi.evaluate.sys_path import (_get_parent_dir_with_file,
|
|||||||
_check_module)
|
_check_module)
|
||||||
from jedi.evaluate import Evaluator
|
from jedi.evaluate import Evaluator
|
||||||
from jedi.evaluate.representation import ModuleContext
|
from jedi.evaluate.representation import ModuleContext
|
||||||
from parso import parse
|
|
||||||
from parso import load_python_grammar
|
|
||||||
|
|
||||||
from ..helpers import cwd_at
|
from ..helpers import cwd_at
|
||||||
|
|
||||||
|
|
||||||
def check_module_test(code):
|
def check_module_test(code):
|
||||||
grammar = load_python_grammar()
|
grammar = parso.load_grammar()
|
||||||
module_context = ModuleContext(Evaluator(grammar), parse(code), path=None)
|
module_context = ModuleContext(Evaluator(grammar), parso.parse(code), path=None)
|
||||||
return _check_module(module_context)
|
return _check_module(module_context)
|
||||||
|
|
||||||
|
|
||||||
@@ -67,8 +67,8 @@ def test_sys_path_with_modifications():
|
|||||||
""")
|
""")
|
||||||
|
|
||||||
path = os.path.abspath(os.path.join(os.curdir, 'module_name.py'))
|
path = os.path.abspath(os.path.join(os.curdir, 'module_name.py'))
|
||||||
grammar = load_python_grammar()
|
grammar = parso.load_grammar()
|
||||||
module_node = parse(code, path=path)
|
module_node = parso.parse(code, path=path)
|
||||||
module_context = ModuleContext(Evaluator(grammar), module_node, path=path)
|
module_context = ModuleContext(Evaluator(grammar), module_node, path=path)
|
||||||
paths = sys_path_with_modifications(module_context.evaluator, module_context)
|
paths = sys_path_with_modifications(module_context.evaluator, module_context)
|
||||||
assert '/tmp/.buildout/eggs/important_package.egg' in paths
|
assert '/tmp/.buildout/eggs/important_package.egg' in paths
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
|
|
||||||
|
import parso
|
||||||
|
|
||||||
from jedi._compatibility import builtins, is_py3
|
from jedi._compatibility import builtins, is_py3
|
||||||
from parso import load_python_grammar
|
|
||||||
from jedi.evaluate import compiled, instance
|
from jedi.evaluate import compiled, instance
|
||||||
from jedi.evaluate.representation import FunctionContext
|
from jedi.evaluate.representation import FunctionContext
|
||||||
from jedi.evaluate import Evaluator
|
from jedi.evaluate import Evaluator
|
||||||
@@ -10,7 +11,7 @@ from jedi import Script
|
|||||||
|
|
||||||
|
|
||||||
def _evaluator():
|
def _evaluator():
|
||||||
return Evaluator(load_python_grammar())
|
return Evaluator(parso.load_grammar())
|
||||||
|
|
||||||
|
|
||||||
def test_simple():
|
def test_simple():
|
||||||
|
|||||||
Reference in New Issue
Block a user