|
1 | 1 | # Stubs for unittest
|
2 | 2 |
|
3 | 3 | from typing import (
|
4 |
| - Any, Callable, Container, ContextManager, Dict, FrozenSet, Generic, Iterable, |
| 4 | + Any, AnyStr, Callable, Container, ContextManager, Dict, FrozenSet, Generic, Iterable, |
5 | 5 | Iterator, List, NoReturn, Optional, overload, Pattern, Sequence, Set, TextIO,
|
6 | 6 | Tuple, Type, TypeVar, Union
|
7 | 7 | )
|
@@ -111,9 +111,9 @@ class TestCase:
|
111 | 111 | def assertNotAlmostEqual(self, first: float, second: float,
|
112 | 112 | places: int = ..., msg: Any = ...,
|
113 | 113 | delta: float = ...) -> None: ...
|
114 |
| - def assertRegex(self, text: str, regex: Union[str, Pattern[str]], |
| 114 | + def assertRegex(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], |
115 | 115 | msg: Any = ...) -> None: ...
|
116 |
| - def assertNotRegex(self, text: str, regex: Union[str, Pattern[str]], |
| 116 | + def assertNotRegex(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], |
117 | 117 | msg: Any = ...) -> None: ...
|
118 | 118 | def assertCountEqual(self, first: Iterable[Any], second: Iterable[Any],
|
119 | 119 | msg: Any = ...) -> None: ...
|
@@ -168,7 +168,7 @@ class TestCase:
|
168 | 168 | def assertNotAlmostEquals(self, first: float, second: float,
|
169 | 169 | places: int = ..., msg: Any = ...,
|
170 | 170 | delta: float = ...) -> None: ...
|
171 |
| - def assertRegexpMatches(self, text: str, regex: Union[str, Pattern[str]], |
| 171 | + def assertRegexpMatches(self, text: AnyStr, regex: Union[AnyStr, Pattern[AnyStr]], |
172 | 172 | msg: Any = ...) -> None: ...
|
173 | 173 | @overload
|
174 | 174 | def assertRaisesRegexp(self, # type: ignore
|
|
0 commit comments