forked from VimPlug/jedi
Fix issues with getitem on compiled objects that have annotations, see #1719
This commit is contained in:
@@ -603,8 +603,11 @@ def test_dict_getitem(code, types):
|
||||
@pytest.mark.parametrize(
|
||||
'code, expected', [
|
||||
('DunderCls()[0]', 'int'),
|
||||
('dunder[0]', 'int'),
|
||||
('next(DunderCls())', 'float'),
|
||||
('next(dunder)', 'float'),
|
||||
('for x in DunderCls(): x', 'str'),
|
||||
#('for x in dunder: x', 'str'),
|
||||
]
|
||||
)
|
||||
def test_dunders(class_is_findable, code, expected):
|
||||
@@ -623,6 +626,8 @@ def test_dunders(class_is_findable, code, expected):
|
||||
if not class_is_findable:
|
||||
DunderCls.__name__ = 'asdf'
|
||||
|
||||
dunder = DunderCls()
|
||||
|
||||
n, = jedi.Interpreter(code, [locals()]).infer()
|
||||
assert n.name == expected
|
||||
|
||||
|
||||
Reference in New Issue
Block a user