1
0
forked from VimPlug/jedi

Reenable call signature caching and move a lot of parser specific caching to the parser itself.

This commit is contained in:
Dave Halter
2016-06-28 08:46:29 +02:00
parent 746a513ef9
commit 52c42c3392
10 changed files with 65 additions and 251 deletions

View File

@@ -7,6 +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
def test_preload_modules():
@@ -16,16 +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]
from jedi import cache
temp_cache, cache.parser_cache = cache.parser_cache, {}
parser_cache = cache.parser_cache
temp_cache, utils.parser_cache = utils.parser_cache, {}
parser_cache = utils.parser_cache
api.preload_module('sys')
check_loaded() # compiled (c_builtin) modules shouldn't be in the cache.
api.preload_module('json', 'token')
check_loaded('json', 'token')
cache.parser_cache = temp_cache
utils.parser_cache = temp_cache
def test_empty_script():