| 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: |