def METHOD_NAME(testfunc, name):
    """Decorator skipping test if given testfunc fails."""
    def check_func(func):
        @wraps(func)
        def newfunc(*args, **kwargs):
            if not testfunc():
                pytest.skip("%s is not available" % name)
            return func(*args, **kwargs)
        return newfunc
    return check_func