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

Function pytest_terminal_summary

src/_pytest/pastebin.py:94–110  ·  view source on GitHub ↗
(terminalreporter: TerminalReporter)

Source from the content-addressed store, hash-verified

92
93
94def pytest_terminal_summary(terminalreporter: TerminalReporter) -> None:
95 if terminalreporter.config.option.pastebin != "failed":
96 return
97 if "failed" in terminalreporter.stats:
98 terminalreporter.write_sep("=", "Sending information to Paste Service")
99 for rep in terminalreporter.stats["failed"]:
100 try:
101 msg = rep.longrepr.reprtraceback.reprentries[-1].reprfileloc
102 except AttributeError:
103 msg = terminalreporter._getfailureheadline(rep)
104 file = StringIO()
105 tw = create_terminal_writer(terminalreporter.config, file)
106 rep.toterminal(tw)
107 s = file.getvalue()
108 assert len(s)
109 pastebinurl = create_new_paste(s)
110 terminalreporter.write_line(f"{msg} --> {pastebinurl}")

Callers

nothing calls this directly

Calls 7

create_terminal_writerFunction · 0.90
create_new_pasteFunction · 0.85
write_sepMethod · 0.80
_getfailureheadlineMethod · 0.80
write_lineMethod · 0.80
toterminalMethod · 0.45
getvalueMethod · 0.45

Tested by

no test coverage detected