(config: Config)
| 50 | |
| 51 | |
| 52 | def pytest_unconfigure(config: Config) -> None: |
| 53 | if pastebinfile_key in config.stash: |
| 54 | pastebinfile = config.stash[pastebinfile_key] |
| 55 | # Get terminal contents and delete file. |
| 56 | pastebinfile.seek(0) |
| 57 | sessionlog = pastebinfile.read() |
| 58 | pastebinfile.close() |
| 59 | del config.stash[pastebinfile_key] |
| 60 | # Undo our patching in the terminal reporter. |
| 61 | tr = config.pluginmanager.getplugin("terminalreporter") |
| 62 | del tr._tw.__dict__["write"] |
| 63 | # Write summary. |
| 64 | tr.write_sep("=", "Sending information to Paste Service") |
| 65 | pastebinurl = create_new_paste(sessionlog) |
| 66 | tr.write_line("pastebin session-log: %s\n" % pastebinurl) |
| 67 | |
| 68 | |
| 69 | def create_new_paste(contents: Union[str, bytes]) -> str: |
nothing calls this directly
no test coverage detected