forked from VimPlug/jedi
Fix issue with mixed objects, fixes #1480
This commit is contained in:
@@ -42,10 +42,12 @@ def test_generics_without_definition():
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
'code, expected', [
|
||||
('Foo.method()', 'int'),
|
||||
('Foo.method()', 'int'),
|
||||
('Foo().method()', 'str'),
|
||||
('Foo.method()', 'str'),
|
||||
('foo.method()', 'str'),
|
||||
('Foo().read()', 'str'),
|
||||
('Foo.read()', 'str'),
|
||||
('foo.read()', 'str'),
|
||||
]
|
||||
)
|
||||
def test_generics_methods(code, expected, class_findable):
|
||||
@@ -63,6 +65,8 @@ def test_generics_methods(code, expected, class_findable):
|
||||
def transform(self) -> int:
|
||||
return 42
|
||||
|
||||
foo = Foo()
|
||||
|
||||
defs = jedi.Interpreter(code, [locals()]).infer()
|
||||
if class_findable:
|
||||
def_, = defs
|
||||
|
||||
Reference in New Issue
Block a user