(config: Config)
| 57 | |
| 58 | |
| 59 | def 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 | |
| 76 | def create_new_paste(contents: str | bytes) -> str: |
nothing calls this directly
no test coverage detected