mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Fix signature of assertRaisesRegexp in unittest (#3434)
Fixes mypy false positive `"None" has noattribute "__enter__"` here:
```
class Foo(unittest.TestCase):
def test_foo(self) -> None:
with self.assertRaisesRegexp(Exception, "foo"):
1 / 0
```
Fixes regression introduced in e6c467af82.
This commit is contained in:
@@ -198,7 +198,7 @@ class TestCase:
|
||||
def assertRaisesRegexp(self, # type: ignore
|
||||
exception: Union[Type[BaseException], Tuple[Type[BaseException], ...]],
|
||||
expected_regex: Union[str, bytes, Pattern[str], Pattern[bytes]],
|
||||
callable: Callable[..., Any] = ...,
|
||||
callable: Callable[..., Any],
|
||||
*args: Any, **kwargs: Any) -> None: ...
|
||||
@overload
|
||||
def assertRaisesRegexp(self,
|
||||
|
||||
Reference in New Issue
Block a user