1
0
forked from VimPlug/jedi

Fix issue with mixed objects, fixes #1480

This commit is contained in:
Dave Halter
2020-01-25 15:02:55 +01:00
parent 0435e0e85c
commit da2a55c73f
4 changed files with 27 additions and 5 deletions

View File

@@ -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