1
0
forked from VimPlug/jedi

Fix value/context mixup in mixed, fixes #1479

This commit is contained in:
Dave Halter
2020-01-24 22:08:16 +01:00
parent eaa49aa26b
commit 7683c05de3
2 changed files with 15 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ if sys.version_info > (3, 5):
import pytest
import jedi
from jedi.inference.value import ModuleValue
def interpreter(code, namespace, *args, **kwargs):
@@ -40,3 +41,13 @@ def test_generics():
s = StackWrapper()
print(interpreter('s.stack.pop().', locals()).complete())
def test_mixed_module_cache():
"""Caused by #1479"""
interpreter = jedi.Interpreter('jedi', [{'jedi': jedi}])
d, = interpreter.infer()
assert d.name == 'jedi'
inference_state = interpreter._inference_state
jedi_module, = inference_state.module_cache.get(('jedi',))
assert isinstance(jedi_module, ModuleValue)