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

Function pytest_unconfigure

src/_pytest/pastebin.py:59–73  ·  src/_pytest/pastebin.py::pytest_unconfigure
(config: Config)

Source from the content-addressed store, hash-verified

57
58
59def pytest_unconfigure(config: Config) -> None:
60 if pastebinfile_key in config.stash:
61 pastebinfile = config.stash[pastebinfile_key]
62 class="cm"># Get terminal contents and delete file.
63 pastebinfile.seek(0)
64 sessionlog = pastebinfile.read()
65 pastebinfile.close()
66 del config.stash[pastebinfile_key]
67 class="cm"># Undo our patching in the terminal reporter.
68 tr = config.pluginmanager.getplugin(class="st">"terminalreporter")
69 del tr._tw.__dict__[class="st">"write"]
70 class="cm"># Write summary.
71 tr.write_sep(class="st">"=", class="st">"Sending information to Paste Service")
72 pastebinurl = create_new_paste(sessionlog)
73 tr.write_line(fclass="st">"pastebin session-log: {pastebinurl}\n")
74
75
76def create_new_paste(contents: str | bytes) -> str:

Callers

nothing calls this directly

Calls 7

create_new_pasteFunction · 0.85
seekMethod · 0.80
getpluginMethod · 0.80
write_sepMethod · 0.80
write_lineMethod · 0.80
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected