def METHOD_NAME(cls):
    def raise_dmesg_fail(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            try:
                data = func(*args, **kwargs)
                collect_errors_by_level(level_check=level)
                return data
            except DmesgError as details:
                raise TestFail(repr(details)) from details
        return wrapper
    for key, value in list(vars(cls).items()):
        if callable(value) and value.__name__.startswith("test"):
            setattr(cls, key, raise_dmesg_fail(value))
    return cls