PY-19884 Add a test on type checking of set collection

This commit is contained in:
Mikhail Golubev
2016-06-21 20:20:23 +03:00
parent 437ffb1e2e
commit 3b41422180
2 changed files with 14 additions and 0 deletions
@@ -0,0 +1,9 @@
xs = set([1, 2, 3])
'foo' + <warning descr="Expected type 'Union[str, unicode]', got 'int' instead">xs.pop()</warning>
xs.discard(<weak_warning descr="Expected type 'int' (matched generic type 'TypeVar('T')'), got 'str' instead">'foo'</weak_warning>)
xs.remove(<weak_warning descr="Expected type 'int' (matched generic type 'TypeVar('T')'), got 'str' instead">'bar'</weak_warning>)
xs.add(<weak_warning descr="Expected type 'int' (matched generic type 'TypeVar('T')'), got 'object' instead">object()</weak_warning>)
ys = ['green', 'eggs']
ys.extend(<weak_warning descr="Expected type 'Iterable[str]' (matched generic type 'Iterable[TypeVar('T')]'), got 'Set[int]' instead">xs</weak_warning>)
@@ -300,4 +300,9 @@ public class PyTypeCheckerInspectionTest extends PyTestCase {
public void testAbsSetAndMutableSet() {
doTest();
}
// PY-19884
public void testSetMethods() {
doTest();
}
}