def needs_gridengine(test_item):
    """
    Use as a decorator before test classes or methods to only run them if GridEngine is installed.
    """
    test_item = _mark_test('gridengine', test_item)
    try:
        with open(os.devnull, 'r+') as devnull:
            subprocess.Popen('qsub', stdout=devnull, stderr=devnull, stdin=devnull)
    except __HOLE__:
        return unittest.skip("Skipping test. Install GridEngine to include this test.")(test_item)
    except:
        raise
    else:
        return test_item
dataset/ETHPy150Open BD2KGenomics/toil/src/toil/test/__init__.py/needs_gridengine