Skip to content

Commit

Permalink
Fix context types
Browse files Browse the repository at this point in the history
  • Loading branch information
srittau committed Oct 19, 2019
1 parent 0dc3f74 commit c19c27a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions asserts/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class AssertRaisesContext(Generic[_E]):
def __enter__(self: _S) -> _S: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType]
) -> Optional[bool]: ...
) -> bool: ...
def format_message(self, default_msg: Text) -> Text: ...
def add_test(self, cb: Callable[[_E], None]) -> None: ...
def add_test(self, cb: Callable[[_E], Any]) -> None: ...

class AssertRaisesErrnoContext(AssertRaisesContext[_E]):
expected_errno: int
Expand All @@ -43,9 +43,11 @@ class AssertRaisesRegexContext(AssertRaisesContext[_E]):
class AssertWarnsContext:
def __init__(self, warning_class: Type[Warning], msg_fmt: Text = ...) -> None: ...
def __enter__(self: _S) -> _S: ...
def __exit__(self, exc_type: Type[BaseException], exc_val: BaseException, exc_tb: Any) -> None: ...
def __exit__(
self, exc_type: Optional[Type[BaseException]], exc_val: Optional[BaseException], exc_tb: Optional[TracebackType],
) -> None: ...
def format_message(self) -> Text: ...
def add_test(self, cb: Callable[[Warning], None]) -> None: ...
def add_test(self, cb: Callable[[Warning], bool]) -> None: ...

class AssertWarnsRegexContext(AssertWarnsContext):
pattern: Text
Expand Down

0 comments on commit c19c27a

Please sign in to comment.