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

Method toterminal

src/_pytest/reports.py:78–96  ·  view source on GitHub ↗
(self, out: TerminalWriter)

Source from the content-addressed store, hash-verified

76 def __getattr__(self, key: str) -> Any: ...
77
78 def toterminal(self, out: TerminalWriter) -> None:
79 if hasattr(self, "node"):
80 worker_info = getworkerinfoline(self.node)
81 if worker_info:
82 out.line(worker_info)
83
84 longrepr = self.longrepr
85 if longrepr is None:
86 return
87
88 if hasattr(longrepr, "toterminal"):
89 longrepr_terminal = cast(TerminalRepr, longrepr)
90 longrepr_terminal.toterminal(out)
91 else:
92 try:
93 s = str(longrepr)
94 except UnicodeEncodeError:
95 s = "<unprintable longrepr>"
96 out.line(s)
97
98 def get_sections(self, prefix: str) -> Iterator[tuple[str, str]]:
99 for name, content in self.sections:

Callers 6

longreprtextMethod · 0.95
pytest_terminal_summaryFunction · 0.45
_outrep_summaryMethod · 0.45
_enter_pdbFunction · 0.45

Calls 2

getworkerinfolineFunction · 0.85
lineMethod · 0.45

Tested by

no test coverage detected