mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-16 10:37:52 +08:00
Rename parser.utils to parser.cache.
This commit is contained in:
@@ -7,7 +7,7 @@ from textwrap import dedent
|
||||
from jedi import api
|
||||
from jedi._compatibility import is_py3
|
||||
from pytest import raises
|
||||
from jedi.parser import utils
|
||||
from jedi.parser import cache
|
||||
|
||||
|
||||
def test_preload_modules():
|
||||
@@ -17,15 +17,15 @@ def test_preload_modules():
|
||||
for i in modules:
|
||||
assert [i in k for k in parser_cache.keys() if k is not None]
|
||||
|
||||
temp_cache, utils.parser_cache = utils.parser_cache, {}
|
||||
parser_cache = utils.parser_cache
|
||||
temp_cache, cache.parser_cache = cache.parser_cache, {}
|
||||
parser_cache = cache.parser_cache
|
||||
|
||||
api.preload_module('sys')
|
||||
check_loaded() # compiled (c_builtin) modules shouldn't be in the cache.
|
||||
api.preload_module('types', 'token')
|
||||
check_loaded('types', 'token')
|
||||
|
||||
utils.parser_cache = temp_cache
|
||||
cache.parser_cache = temp_cache
|
||||
|
||||
|
||||
def test_empty_script():
|
||||
|
||||
@@ -9,7 +9,7 @@ import pytest
|
||||
|
||||
import jedi
|
||||
from jedi import settings, cache
|
||||
from jedi.parser.utils import _NodeCacheItem
|
||||
from jedi.parser.cache import _NodeCacheItem
|
||||
from jedi.parser.python import load_grammar
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import jedi
|
||||
from jedi import debug
|
||||
from jedi.common import splitlines
|
||||
from jedi import cache
|
||||
from jedi.parser.utils import parser_cache
|
||||
from jedi.parser.cache import parser_cache
|
||||
from jedi.parser.python import load_grammar
|
||||
from jedi.parser.python.diff import DiffParser
|
||||
from jedi.parser.python import parse
|
||||
|
||||
Reference in New Issue
Block a user