@@ -28,9 +28,9 @@ class AssertRaisesContext(Generic[_E]):
2828 def __enter__ (self : _S ) -> _S : ...
2929 def __exit__ (
3030 self , exc_type : Optional [Type [BaseException ]], exc_val : Optional [BaseException ], exc_tb : Optional [TracebackType ]
31- ) -> Optional [ bool ] : ...
31+ ) -> bool : ...
3232 def format_message (self , default_msg : Text ) -> Text : ...
33- def add_test (self , cb : Callable [[_E ], None ]) -> None : ...
33+ def add_test (self , cb : Callable [[_E ], Any ]) -> None : ...
3434
3535class AssertRaisesErrnoContext (AssertRaisesContext [_E ]):
3636 expected_errno : int
@@ -43,9 +43,11 @@ class AssertRaisesRegexContext(AssertRaisesContext[_E]):
4343class AssertWarnsContext :
4444 def __init__ (self , warning_class : Type [Warning ], msg_fmt : Text = ...) -> None : ...
4545 def __enter__ (self : _S ) -> _S : ...
46- def __exit__ (self , exc_type : Type [BaseException ], exc_val : BaseException , exc_tb : Any ) -> None : ...
46+ def __exit__ (
47+ self , exc_type : Optional [Type [BaseException ]], exc_val : Optional [BaseException ], exc_tb : Optional [TracebackType ],
48+ ) -> None : ...
4749 def format_message (self ) -> Text : ...
48- def add_test (self , cb : Callable [[Warning ], None ]) -> None : ...
50+ def add_test (self , cb : Callable [[Warning ], bool ]) -> None : ...
4951
5052class AssertWarnsRegexContext (AssertWarnsContext ):
5153 pattern : Text
0 commit comments