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

Function pytest_unconfigure

src/_pytest/faulthandler.py:35–45  ·  view source on GitHub ↗
(config: Config)

Source from the content-addressed store, hash-verified

33
34
35def pytest_unconfigure(config: Config) -> None:
36 import faulthandler
37
38 faulthandler.disable()
39 # Close the dup file installed during pytest_configure.
40 if fault_handler_stderr_key in config.stash:
41 config.stash[fault_handler_stderr_key].close()
42 del config.stash[fault_handler_stderr_key]
43 if config.stash.get(fault_handler_originally_enabled_key, False):
44 # Re-enable the faulthandler if it was originally enabled.
45 faulthandler.enable(file=get_stderr_fileno())
46
47
48def get_stderr_fileno() -> int:

Callers

nothing calls this directly

Calls 3

get_stderr_filenoFunction · 0.85
closeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected