(excinfo: ExceptionInfo[BaseException])
| 365 | |
| 366 | |
| 367 | def _postmortem_traceback(excinfo: ExceptionInfo[BaseException]) -> types.TracebackType: |
| 368 | from doctest import UnexpectedException |
| 369 | |
| 370 | if isinstance(excinfo.value, UnexpectedException): |
| 371 | # A doctest.UnexpectedException is not useful for post_mortem. |
| 372 | # Use the underlying exception instead: |
| 373 | return excinfo.value.exc_info[2] |
| 374 | elif isinstance(excinfo.value, ConftestImportFailure): |
| 375 | # A config.ConftestImportFailure is not useful for post_mortem. |
| 376 | # Use the underlying exception instead: |
| 377 | return excinfo.value.excinfo[2] |
| 378 | else: |
| 379 | assert excinfo._excinfo is not None |
| 380 | return excinfo._excinfo[2] |
| 381 | |
| 382 | |
| 383 | def post_mortem(t: types.TracebackType) -> None: |
no outgoing calls
no test coverage detected