MCPcopy
hub / github.com/pytest-dev/pytest / cleanup

Function cleanup

src/_pytest/threadexception.py:77–89  ·  view source on GitHub ↗
(
    *, config: Config, prev_hook: Callable[[threading.ExceptHookArgs], object]
)

Source from the content-addressed store, hash-verified

75
76
77def cleanup(
78 *, config: Config, prev_hook: Callable[[threading.ExceptHookArgs], object]
79) -> None:
80 try:
81 try:
82 # We don't join threads here, so exceptions raised from any
83 # threads still running by the time _threading_atexits joins them
84 # do not get captured (see #13027).
85 collect_thread_exception(config)
86 finally:
87 threading.excepthook = prev_hook
88 finally:
89 del config.stash[thread_exceptions]
90
91
92def thread_exception_hook(

Callers 1

Calls 1

collect_thread_exceptionFunction · 0.85

Tested by 1