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

Method __init__

src/_pytest/outcomes.py:32–41  ·  view source on GitHub ↗
(self, msg: Optional[str] = None, pytrace: bool = True)

Source from the content-addressed store, hash-verified

30 about test and collection outcomes."""
31
32 def __init__(self, msg: Optional[str] = None, pytrace: bool = True) -> None:
33 if msg is not None and not isinstance(msg, str):
34 error_msg = ( # type: ignore[unreachable]
35 "{} expected string as 'msg' parameter, got '{}' instead.\n"
36 "Perhaps you meant to use a mark?"
37 )
38 raise TypeError(error_msg.format(type(self).__name__, type(msg).__name__))
39 super().__init__(msg)
40 self.msg = msg
41 self.pytrace = pytrace
42
43 def __repr__(self) -> str:
44 if self.msg is not None:

Callers

nothing calls this directly

Calls 2

formatMethod · 0.45
__init__Method · 0.45

Tested by

no test coverage detected