Check whether the call raised an exception that should be reported as interactive.
(call: CallInfo[object], report: BaseReport)
| 268 | |
| 269 | |
| 270 | def check_interactive_exception(call: CallInfo[object], report: BaseReport) -> bool: |
| 271 | """Check whether the call raised an exception that should be reported as |
| 272 | interactive.""" |
| 273 | if call.excinfo is None: |
| 274 | # Didn't raise. |
| 275 | return False |
| 276 | if hasattr(report, "wasxfail"): |
| 277 | # Exception was expected. |
| 278 | return False |
| 279 | unittest = sys.modules.get("unittest") |
| 280 | if isinstance(call.excinfo.value, Skipped | bdb.BdbQuit) or ( |
| 281 | unittest is not None and isinstance(call.excinfo.value, unittest.SkipTest) |
| 282 | ): |
| 283 | # Special control flow exception. |
| 284 | return False |
| 285 | return True |
| 286 | |
| 287 | |
| 288 | TResult = TypeVar("TResult", covariant=True) |