failure.pyi 691 B

123456789101112131415161718192021222324
  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] = ...,
  8. exc_type: Optional[Type[BaseException]] = ...,
  9. exc_tb: Optional[TracebackType] = ...,
  10. captureVars: bool = ...,
  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]: ...
  18. def getTraceback(
  19. self,
  20. elideFrameworkCode: int = ...,
  21. detail: str = ...,
  22. ) -> str: ...