()
| 121 | |
| 122 | @pytest.hookimpl(wrapper=True) |
| 123 | def pytest_cmdline_parse() -> Generator[None, Config, Config]: |
| 124 | config = yield |
| 125 | |
| 126 | if config.option.debug: |
| 127 | class="cm"># --debug | --debug <file.log> was provided. |
| 128 | path = config.option.debug |
| 129 | debugfile = open(path, class="st">"w", encoding=class="st">"utf-8") |
| 130 | debugfile.write( |
| 131 | class="st">"versions pytest-{}, " |
| 132 | class="st">"python-{}\ninvocation_dir={}\ncwd={}\nargs={}\n\n".format( |
| 133 | pytest.__version__, |
| 134 | class="st">".".join(map(str, sys.version_info)), |
| 135 | config.invocation_params.dir, |
| 136 | os.getcwd(), |
| 137 | config.invocation_params.args, |
| 138 | ) |
| 139 | ) |
| 140 | config.trace.root.setwriter(debugfile.write) |
| 141 | undo_tracing = config.pluginmanager.enable_tracing() |
| 142 | sys.stderr.write(fclass="st">"writing pytest debug information to {path}\n") |
| 143 | |
| 144 | def unset_tracing() -> None: |
| 145 | debugfile.close() |
| 146 | sys.stderr.write(fclass="st">"wrote pytest debug information to {debugfile.name}\n") |
| 147 | config.trace.root.setwriter(None) |
| 148 | undo_tracing() |
| 149 | |
| 150 | config.add_cleanup(unset_tracing) |
| 151 | |
| 152 | return config |
| 153 | |
| 154 | |
| 155 | def show_version_verbose(config: Config) -> None: |
nothing calls this directly
no test coverage detected