Implement the internals of the pytest_runtest_xxx() hooks.
(self, item: nodes.Item, when: str)
| 691 | self.log_cli_handler.set_when("logreport") |
| 692 | |
| 693 | def _runtest_for(self, item: nodes.Item, when: str) -> Generator[None, None, None]: |
| 694 | """Implement the internals of the pytest_runtest_xxx() hooks.""" |
| 695 | with catching_logs( |
| 696 | self.caplog_handler, |
| 697 | level=self.log_level, |
| 698 | ) as caplog_handler, catching_logs( |
| 699 | self.report_handler, |
| 700 | level=self.log_level, |
| 701 | ) as report_handler: |
| 702 | caplog_handler.reset() |
| 703 | report_handler.reset() |
| 704 | item.stash[caplog_records_key][when] = caplog_handler.records |
| 705 | item.stash[caplog_handler_key] = caplog_handler |
| 706 | |
| 707 | yield |
| 708 | |
| 709 | log = report_handler.stream.getvalue().strip() |
| 710 | item.add_report_section(when, "log", log) |
| 711 | |
| 712 | @hookimpl(hookwrapper=True) |
| 713 | def pytest_runtest_setup(self, item: nodes.Item) -> Generator[None, None, None]: |
no test coverage detected