def knownfailureif(fail_condition, msg=None):
    if msg is None:
        msg = 'Test skipped due to known failure'

    # Allow for both boolean or callable known failure conditions.
    if isinstance(fail_condition, collections.Callable):
        fail_val = lambda : fail_condition()
    else:
        fail_val = lambda : fail_condition

    def knownfail_decorator(f):
        # Local import to avoid a hard nose dependency and only incur the
        # import time overhead at actual test-time.
        import nose
        def knownfailer(*args, **kwargs):
            if fail_val():
                raise KnownFailureTest(msg)
            else:
                return f(*args, **kwargs)
        return nose.tools.make_decorator(f)(knownfailer)

    return knownfail_decorator
ix handler
dataset/ETHPy150Open ipython/ipython-py3k/IPython/external/decorators/_decorators.py/knownfailureif--crossover with--dataset/ETHPy150Open moocowmoo/dashvend/bin/dashvend/dash_ix.py/InstantX.recv_ix