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

Method __str__

src/_pytest/_code/code.py:965–971  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

963@attr.s(eq=False, auto_attribs=True)
964class TerminalRepr:
965 def __str__(self) -> str:
966 # FYI this is called from pytest-xdist's serialization of exception
967 # information.
968 io = StringIO()
969 tw = TerminalWriter(file=io)
970 self.toterminal(tw)
971 return io.getvalue().strip()
972
973 def __repr__(self) -> str:
974 return f"<{self.__class__} instance at {id(self):0x}>"

Callers

nothing calls this directly

Calls 4

toterminalMethod · 0.95
TerminalWriterClass · 0.90
stripMethod · 0.80
getvalueMethod · 0.45

Tested by

no test coverage detected