(early_config: Config)
| 154 | |
| 155 | @hookimpl(wrapper=True) |
| 156 | def pytest_load_initial_conftests(early_config: Config) -> Generator[None]: |
| 157 | ns = early_config.known_args_namespace |
| 158 | if ns.capture == "fd": |
| 159 | _windowsconsoleio_workaround(sys.stdout) |
| 160 | _colorama_workaround() |
| 161 | _readline_workaround() |
| 162 | pluginmanager = early_config.pluginmanager |
| 163 | capman = CaptureManager(ns.capture) |
| 164 | pluginmanager.register(capman, "capturemanager") |
| 165 | |
| 166 | # Make sure that capturemanager is properly reset at final shutdown. |
| 167 | early_config.add_cleanup(capman.stop_global_capturing) |
| 168 | |
| 169 | # Finally trigger conftest loading but while capturing (issue #93). |
| 170 | capman.start_global_capturing() |
| 171 | try: |
| 172 | try: |
| 173 | yield |
| 174 | finally: |
| 175 | capman.suspend_global_capture() |
| 176 | except BaseException: |
| 177 | out, err = capman.read_global_capture() |
| 178 | sys.stdout.write(out) |
| 179 | sys.stderr.write(err) |
| 180 | raise |
| 181 | |
| 182 | |
| 183 | # IO Helpers. |
nothing calls this directly
no test coverage detected