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

Function pytest_unconfigure

src/_pytest/pastebin.py:59–73  ·  view source on GitHub ↗
(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 # Get terminal contents and delete file.
63 pastebinfile.seek(0)
64 sessionlog = pastebinfile.read()
65 pastebinfile.close()
66 del config.stash[pastebinfile_key]
67 # Undo our patching in the terminal reporter.
68 tr = config.pluginmanager.getplugin("terminalreporter")
69 del tr._tw.__dict__["write"]
70 # Write summary.
71 tr.write_sep("=", "Sending information to Paste Service")
72 pastebinurl = create_new_paste(sessionlog)
73 tr.write_line(f"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

Used in the wild real call sites across dependent graphs

searching dependent graphs…