def needs_mesos(test_item):
    """
    Use as a decorator before test classes or methods to only run them if the Mesos is installed
    and configured.
    """
    test_item = _mark_test('mesos', test_item)
    try:
        # noinspection PyUnresolvedReferences
        import mesos.native
    except __HOLE__:
        return unittest.skip("Skipping test. Install toil with the 'mesos' extra to include this "
                             "test.")(test_item)
    except:
        raise
    else:
        return test_item
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/__init__.py/needs_mesos