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

Function _with_exception

src/_pytest/outcomes.py:103–109  ·  view source on GitHub ↗
(exception_type: _ET)

Source from the content-addressed store, hash-verified

101
102
103def _with_exception(exception_type: _ET) -> Callable[[_F], _WithException[_F, _ET]]:
104 def decorate(func: _F) -> _WithException[_F, _ET]:
105 func_with_exception = cast(_WithException[_F, _ET], func)
106 func_with_exception.Exception = exception_type
107 return func_with_exception
108
109 return decorate
110
111
112# Exposed helper methods.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected