(
node: Node, excinfo: ExceptionInfo[BaseException], rep: BaseReport
)
| 335 | |
| 336 | |
| 337 | def _enter_pdb( |
| 338 | node: Node, excinfo: ExceptionInfo[BaseException], rep: BaseReport |
| 339 | ) -> BaseReport: |
| 340 | # XXX we reuse the TerminalReporter's terminalwriter |
| 341 | # because this seems to avoid some encoding related troubles |
| 342 | # for not completely clear reasons. |
| 343 | tw = node.config.pluginmanager.getplugin("terminalreporter")._tw |
| 344 | tw.line() |
| 345 | |
| 346 | showcapture = node.config.option.showcapture |
| 347 | |
| 348 | for sectionname, content in ( |
| 349 | ("stdout", rep.capstdout), |
| 350 | ("stderr", rep.capstderr), |
| 351 | ("log", rep.caplog), |
| 352 | ): |
| 353 | if showcapture in (sectionname, "all") and content: |
| 354 | tw.sep(">", "captured " + sectionname) |
| 355 | if content[-1:] == "\n": |
| 356 | content = content[:-1] |
| 357 | tw.line(content) |
| 358 | |
| 359 | tw.sep(">", "traceback") |
| 360 | rep.toterminal(tw) |
| 361 | tw.sep(">", "entering PDB") |
| 362 | tb_or_exc = _postmortem_exc_or_tb(excinfo) |
| 363 | rep._pdbshown = True # type: ignore[attr-defined] |
| 364 | post_mortem(tb_or_exc) |
| 365 | return rep |
| 366 | |
| 367 | |
| 368 | def _postmortem_exc_or_tb( |
no test coverage detected