mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 08:47:39 +08:00
Relax type of TestCase.assertCountEqual() params from Sequence to Iterable (#1006)
The stubs for `unittest.TestCase.assertCountEqual()` specify the parameters are Sequences; in fact the method works fine with Iterables, as the first thing the method does is convert them to lists. [1] The docs do say sequences, but it appears there is no reason they cannot be Iterables. [1]: https://github.com/python/cpython/blob/master/Lib/unittest/case.py#L1156
This commit is contained in:
@@ -117,7 +117,7 @@ class TestCase:
|
||||
msg: Any = ...) -> None: ...
|
||||
def assertNotRegex(self, text: str, regex: Union[str, Pattern[str]],
|
||||
msg: Any = ...) -> None: ...
|
||||
def assertCountEqual(self, first: Sequence[Any], second: Sequence[Any],
|
||||
def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any],
|
||||
msg: Any = ...) -> None: ...
|
||||
def addTypeEqualityFunc(self, typeobj: Type[Any],
|
||||
function: Callable[..., None]) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user