def _need_func(testfunc, name, description):
    """Decorator skipping test if given testfunc returns False."""
    def check_func(func):
        def newfunc(*args, **kwargs):
            if not testfunc(name):
                pytest.skip("%s %r is not available" % (description, name))
            return func(*args, **kwargs)
        setattr(newfunc, fnameattr, getattr(func, fnameattr))
        return newfunc
    return check_func