failure.pyi 572 B

12345678910111213141516171819
  1. from types import TracebackType
  2. from typing import Optional, Type, TypeVar, Union, overload
  3. E = TypeVar("E")
  4. class Failure(BaseException):
  5. def __init__(
  6. self,
  7. exc_value: Optional[BaseException] = None,
  8. exc_type: Optional[Type[BaseException]] = None,
  9. exc_tb: Optional[TracebackType] = None,
  10. captureVars: bool = False,
  11. ): ...
  12. @overload
  13. def check(self, singleErrorType: Type[E]) -> Optional[E]: ...
  14. @overload
  15. def check(
  16. self, *errorTypes: Union[str, Type[Exception]]
  17. ) -> Optional[Exception]: ...