Skip to content

Commit c7f6034

Browse files
committed
Fix type signature of AssertRaisesContext.__exit__()
1 parent 154156c commit c7f6034

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

NEWS.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
News in asserts 0.8.3
22
=====================
33

4+
Bug Fixes
5+
---------
6+
7+
* Fix type signature of `AssertRaisesContext.__exit__()`.
8+
49
News in asserts 0.8.2
510
=====================
611

asserts/__init__.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
import datetime
22

3+
from types import TracebackType
34
from typing import \
4-
Any, Container, List, Type, Callable, Tuple, Union, ContextManager, \
5+
Any, Container, Type, Callable, Tuple, Union, ContextManager, \
56
Pattern, Optional, Iterable
67

78
class AssertRaisesContext:
89
exception = ... # type: Type[BaseException]
910
msg_fmt = ... # type: str
1011
def __init__(self, exception: Type[BaseException], msg_fmt: str = ...) -> None: ...
1112
def __enter__(self) -> AssertRaisesContext: ...
12-
def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: Any) -> None: ...
13+
def __exit__(self, exc_type: Optional[Type[BaseException]],
14+
exc_val: Optional[BaseException],
15+
exc_tb: Optional[TracebackType]) -> Optional[bool]: ...
1316
def format_message(self, default_msg: str) -> str: ...
1417
def add_test(self, cb: Callable[[BaseException], None]) -> None: ...
1518

0 commit comments

Comments
 (0)