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

Method repr_instance

src/_pytest/_io/saferepr.py:72–82  ·  view source on GitHub ↗
(self, x: object, level: int)

Source from the content-addressed store, hash-verified

70 return s
71
72 def repr_instance(self, x: object, level: int) -> str:
73 try:
74 s = repr(x)
75 except (KeyboardInterrupt, SystemExit):
76 raise
77 except BaseException as exc:
78 s = _format_repr_exception(exc, x)
79 if self.maxsize is not None:
80 s = _ellipsize(s, self.maxsize)
81
82 return s
83
84 def repr_dict(self, x: dict[object, object], level: int) -> str:
85 """Represent a dict while preserving its insertion order.

Callers

nothing calls this directly

Calls 2

_format_repr_exceptionFunction · 0.85
_ellipsizeFunction · 0.85

Tested by

no test coverage detected