mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 05:11:09 +08:00
fix type for TestCase.assertIn (#2186)
* fix type for TestCase.assertIn
This does essentially `assert member in container`, so we want a `Container`, not an `Iterable`.
This came up in 68e9d426a8..0bbee43d60 (r192525658).
* use any for assertIn
This commit is contained in:
committed by
Łukasz Langa
parent
9ec6d476c4
commit
eef0b1d562
@@ -1,9 +1,9 @@
|
||||
# Stubs for unittest
|
||||
|
||||
from typing import (
|
||||
Any, Callable, ContextManager, Dict, FrozenSet, Generic, Iterable, Iterator,
|
||||
List, NoReturn, Optional, overload, Pattern, Sequence, Set, TextIO, Tuple,
|
||||
Type, TypeVar, Union
|
||||
Any, Callable, Container, ContextManager, Dict, FrozenSet, Generic, Iterable,
|
||||
Iterator, List, NoReturn, Optional, overload, Pattern, Sequence, Set, TextIO,
|
||||
Tuple, Type, TypeVar, Union
|
||||
)
|
||||
import logging
|
||||
import sys
|
||||
@@ -50,9 +50,9 @@ class TestCase:
|
||||
msg: Any = ...) -> None: ...
|
||||
def assertIsNone(self, expr: Any, msg: Any = ...) -> None: ...
|
||||
def assertIsNotNone(self, expr: Any, msg: Any = ...) -> None: ...
|
||||
def assertIn(self, first: _T, second: Iterable[_T],
|
||||
def assertIn(self, member: Any, container: Container[Any],
|
||||
msg: Any = ...) -> None: ...
|
||||
def assertNotIn(self, first: _T, second: Iterable[_T],
|
||||
def assertNotIn(self, member: Any, container: Container[Any],
|
||||
msg: Any = ...) -> None: ...
|
||||
def assertIsInstance(self, obj: Any,
|
||||
cls: Union[type, Tuple[type, ...]],
|
||||
|
||||
Reference in New Issue
Block a user