forked from VimPlug/jedi
Remove some other _star_import_cache stuff, and with this, #489 should be fixed.
This commit is contained in:
@@ -33,8 +33,6 @@ from jedi import debug
|
|||||||
|
|
||||||
_time_caches = {}
|
_time_caches = {}
|
||||||
|
|
||||||
_star_import_cache = {}
|
|
||||||
|
|
||||||
# for fast_parser, should not be deleted
|
# for fast_parser, should not be deleted
|
||||||
parser_cache = {}
|
parser_cache = {}
|
||||||
|
|
||||||
@@ -59,7 +57,6 @@ def clear_time_caches(delete_all=False):
|
|||||||
if delete_all:
|
if delete_all:
|
||||||
for cache in _time_caches.values():
|
for cache in _time_caches.values():
|
||||||
cache.clear()
|
cache.clear()
|
||||||
_star_import_cache.clear()
|
|
||||||
parser_cache.clear()
|
parser_cache.clear()
|
||||||
else:
|
else:
|
||||||
# normally just kill the expired entries, not all
|
# normally just kill the expired entries, not all
|
||||||
|
|||||||
@@ -67,7 +67,9 @@ def test_star_import_cache_duration():
|
|||||||
old, jedi.settings.star_import_cache_validity = \
|
old, jedi.settings.star_import_cache_validity = \
|
||||||
jedi.settings.star_import_cache_validity, new
|
jedi.settings.star_import_cache_validity, new
|
||||||
|
|
||||||
cache._star_import_cache = {} # first empty...
|
dct = cache._time_caches['star_import_cache_validity']
|
||||||
|
old_dct = dict(dct)
|
||||||
|
dct.clear() # first empty...
|
||||||
# path needs to be not-None (otherwise caching effects are not visible)
|
# path needs to be not-None (otherwise caching effects are not visible)
|
||||||
jedi.Script('', 1, 0, '').completions()
|
jedi.Script('', 1, 0, '').completions()
|
||||||
time.sleep(2 * new)
|
time.sleep(2 * new)
|
||||||
@@ -75,7 +77,8 @@ def test_star_import_cache_duration():
|
|||||||
|
|
||||||
# reset values
|
# reset values
|
||||||
jedi.settings.star_import_cache_validity = old
|
jedi.settings.star_import_cache_validity = old
|
||||||
assert len(cache._star_import_cache) == 1
|
assert len(dct) == 1
|
||||||
|
dct = old_dct
|
||||||
cache._star_import_cache = {}
|
cache._star_import_cache = {}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user