Skip to content

Commit 7ccb730

Browse files
committed
Add tests
1 parent 7ce3b9e commit 7ccb730

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

mypy/test/teststubtest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,6 +1601,16 @@ def test_dunders(self) -> Iterator[Case]:
16011601
runtime="class D:\n def __class_getitem__(cls, type): ...",
16021602
error=None,
16031603
)
1604+
yield Case(
1605+
stub="class E:\n def __getitem__(self, item: object) -> object: ...",
1606+
runtime="class E:\n def __getitem__(self, item: object, /) -> object: ...",
1607+
error="E.__getitem__",
1608+
)
1609+
yield Case(
1610+
stub="class F:\n def __getitem__(self, item: object, /) -> object: ...",
1611+
runtime="class F:\n def __getitem__(self, item: object) -> object: ...",
1612+
error=None,
1613+
)
16041614

16051615
@collect_cases
16061616
def test_not_subclassable(self) -> Iterator[Case]:

0 commit comments

Comments
 (0)