mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-19884 Add a test on type checking of set collection
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user