def disable_if(predicate):
    """
    Disables a test if predicate yields True at parse time.

    @param predicate: a callable that gets passed the test as whole or the
        method under test and returns a bool
    @param reason: function that is responsible for the conditional, if nothing
        is passed, disable_if is assumed (used for disable_unless)
    @return: a decorator
    """
    def _decorator(f):
        if predicate():
            f.__test__ = False
        return f
    return _decorator