@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
    # execute all other hooks to obtain the report object
    outcome = yield
    rep = outcome.get_result()

    # we only look at actual failing test calls, not setup/teardown
    if rep.when == "call" and rep.failed:
        if "browser" in item.fixturenames:
            browser = item.funcargs["browser"]
            for log_type in (set(browser.log_types) + {"har"}):
                data = "\n\n".join(
                    filter(
                        None,
                        (l.get("message") for l in browser.get_log(log_type)))
                )
                if data:
                    rep.sections.append(
                        ("Captured {} log".format(log_type), data)
                    )
dataset/ETHPy150Open pypa/warehouse/tests/conftest.py/pytest_runtest_makereport/operator `-` -> `+`