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

Method __str__

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

Source from the content-addressed store, hash-verified

1252 themselves to a terminal."""
1253
1254 def __str__(self) -> str:
1255 # FYI this is called from pytest-xdist's serialization of exception
1256 # information.
1257 io = StringIO()
1258 tw = TerminalWriter(file=io)
1259 self.toterminal(tw)
1260 return io.getvalue().strip()
1261
1262 def __repr__(self) -> str:
1263 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