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