Add a test covering another scenario broken due to implementation of getReceiver()

used in PyiTypeProvider. That was fixed in 8eda017f0f
This commit is contained in:
Mikhail Golubev
2017-11-30 15:19:58 +03:00
parent 63f25e8e4d
commit 1b13e20a8b
4 changed files with 35 additions and 0 deletions
@@ -0,0 +1,3 @@
from lib import MyClass
ex<caret>pr = 42 < MyClass(42) < MyClass('foo')
@@ -0,0 +1,9 @@
class MyClass:
def __init__(self, *args):
pass
def __lt__(self, other):
pass
def __gt__(self, other):
return True
@@ -0,0 +1,19 @@
from typing import overload, Generic, TypeVar
T = TypeVar('T')
class MyClass(Generic[T]):
def __init__(self, x: T):
pass
@overload
def __lt__(self, other: MyClass) -> T:
pass
@overload
def __lt__(self, other: str) -> bool:
pass
def __gt__(self, other: int) -> bool:
pass
@@ -142,4 +142,8 @@ public class PyiTypeTest extends PyTestCase {
public void testGenericClassDefinitionInSameFile() {
doTest("int");
}
public void testComparisonOperatorOverloads() {
doTest("int");
}
}