def assert_no_logs(function):
    @functools.wraps(function)
    def wrapper(*args, **kwargs):
        with capture_logs() as logs:
            try:
                function(*args, **kwargs)
            except Exception:  # pragma: no cover
                if logs:
                    print('%i errors logged:' % len(logs), file=sys.stderr)
                    for message in logs:
                        print(message, file=sys.stderr)
                raise
            else:
                if logs:
                    for message in logs:
                        print(message, file=sys.stderr)
                    raise AssertionError('%i errors logged' % len(logs))
    return wrapper
Parses from a file.
dataset/ETHPy150Open Kozea/WeasyPrint/weasyprint/tests/testing_utils.py/assert_no_logs--crossover with--dataset/ETHPy150Open letsencrypt/letsencrypt/certbot-nginx/certbot_nginx/nginxparser.py/load