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

Class ExceptionChainRepr

src/_pytest/_code/code.py:1000–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

998
999@attr.s(eq=False, auto_attribs=True)
1000class ExceptionChainRepr(ExceptionRepr):
1001 chain: Sequence[Tuple["ReprTraceback", Optional["ReprFileLocation"], Optional[str]]]
1002
1003 def __attrs_post_init__(self) -> None:
1004 super().__attrs_post_init__()
1005 # reprcrash and reprtraceback of the outermost (the newest) exception
1006 # in the chain.
1007 self.reprtraceback = self.chain[-1][0]
1008 self.reprcrash = self.chain[-1][1]
1009
1010 def toterminal(self, tw: TerminalWriter) -> None:
1011 for element in self.chain:
1012 element[0].toterminal(tw)
1013 if element[2] is not None:
1014 tw.line("")
1015 tw.line(element[2], yellow=True)
1016 super().toterminal(tw)
1017
1018
1019@attr.s(eq=False, auto_attribs=True)

Callers 2

_report_kwargs_from_jsonFunction · 0.90
repr_excinfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected