MCPcopy Create free account
hub / github.com/pytest-dev/pytest / __init__

Method __init__

src/_pytest/python_api.py:929–938  ·  view source on GitHub ↗
(
        self,
        expected_exception: Union[Type[E], Tuple[Type[E], ...]],
        message: str,
        match_expr: Optional[Union[str, Pattern[str]]] = None,
    )

Source from the content-addressed store, hash-verified

927@final
928class RaisesContext(Generic[E]):
929 def __init__(
930 self,
931 expected_exception: Union[Type[E], Tuple[Type[E], ...]],
932 message: str,
933 match_expr: Optional[Union[str, Pattern[str]]] = None,
934 ) -> None:
935 self.expected_exception = expected_exception
936 self.message = message
937 self.match_expr = match_expr
938 self.excinfo: Optional[_pytest._code.ExceptionInfo[E]] = None
939
940 def __enter__(self) -> _pytest._code.ExceptionInfo[E]:
941 self.excinfo = _pytest._code.ExceptionInfo.for_later()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected