(
item: Item, when: "Literal['setup', 'call', 'teardown']", **kwds
)
| 244 | |
| 245 | |
| 246 | def call_runtest_hook( |
| 247 | item: Item, when: "Literal['setup', 'call', 'teardown']", **kwds |
| 248 | ) -> "CallInfo[None]": |
| 249 | if when == "setup": |
| 250 | ihook: Callable[..., None] = item.ihook.pytest_runtest_setup |
| 251 | elif when == "call": |
| 252 | ihook = item.ihook.pytest_runtest_call |
| 253 | elif when == "teardown": |
| 254 | ihook = item.ihook.pytest_runtest_teardown |
| 255 | else: |
| 256 | assert False, f"Unhandled runtest hook case: {when}" |
| 257 | reraise: Tuple[Type[BaseException], ...] = (Exit,) |
| 258 | if not item.config.getoption("usepdb", False): |
| 259 | reraise += (KeyboardInterrupt,) |
| 260 | return CallInfo.from_call( |
| 261 | lambda: ihook(item=item, **kwds), when=when, reraise=reraise |
| 262 | ) |
| 263 | |
| 264 | |
| 265 | TResult = TypeVar("TResult", covariant=True) |
no test coverage detected