MCPcopy
hub / github.com/pytest-dev/pytest / __repr__

Method __repr__

src/_pytest/raises.py:1051–1065  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1049 return self.excinfo
1050
1051 def __repr__(self) -> str:
1052 reqs = [
1053 e.__name__ if isinstance(e, type) else repr(e)
1054 for e in self.expected_exceptions
1055 ]
1056 if self.allow_unwrapped:
1057 reqs.append(f"allow_unwrapped={self.allow_unwrapped}")
1058 if self.flatten_subgroups:
1059 reqs.append(f"flatten_subgroups={self.flatten_subgroups}")
1060 if self.match is not None:
1061 # If no flags were specified, discard the redundant re.compile() here.
1062 reqs.append(f"match={_match_pattern(self.match)!r}")
1063 if self.check is not None:
1064 reqs.append(f"check={repr_callable(self.check)}")
1065 return f"RaisesGroup({', '.join(reqs)})"
1066
1067 def _unroll_exceptions(
1068 self,

Callers

nothing calls this directly

Calls 4

_match_patternFunction · 0.85
repr_callableFunction · 0.85
appendMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected