MCPcopy Create free account
hub / github.com/pytest-dev/pytest / pytest_load_initial_conftests

Function pytest_load_initial_conftests

src/_pytest/capture.py:128–147  ·  view source on GitHub ↗
(early_config: Config)

Source from the content-addressed store, hash-verified

126
127@hookimpl(hookwrapper=True)
128def pytest_load_initial_conftests(early_config: Config):
129 ns = early_config.known_args_namespace
130 if ns.capture == "fd":
131 _py36_windowsconsoleio_workaround(sys.stdout)
132 _colorama_workaround()
133 pluginmanager = early_config.pluginmanager
134 capman = CaptureManager(ns.capture)
135 pluginmanager.register(capman, "capturemanager")
136
137 # Make sure that capturemanager is properly reset at final shutdown.
138 early_config.add_cleanup(capman.stop_global_capturing)
139
140 # Finally trigger conftest loading but while capturing (issue #93).
141 capman.start_global_capturing()
142 outcome = yield
143 capman.suspend_global_capture()
144 if outcome.excinfo is not None:
145 out, err = capman.read_global_capture()
146 sys.stdout.write(out)
147 sys.stderr.write(err)
148
149
150# IO Helpers.

Callers

nothing calls this directly

Calls 9

read_global_captureMethod · 0.95
_colorama_workaroundFunction · 0.85
CaptureManagerClass · 0.85
registerMethod · 0.80
add_cleanupMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected