import pytest fietsctl_results = [] @pytest.hookimpl(hookwrapper=True) def pytest_runtest_call(item): fietsctl_results.clear() yield item.add_report_section( "call", "fietsctl", "\n\n".join(result.report() for result in fietsctl_results) )