/usr/local/lib/python3.6/site-packages/joblib/test
NameSizeModeActions
data/-0755rm
__pycache__/-0755rm
common.py32830644editdlrm
testutils.py2510644editdlrm
test_backports.py11750644editdlrm
test_cloudpickle_wrapper.py7490644editdlrm
test_dask.py170530644editdlrm
test_deprecated_objects.py12490644editdlrm
test_disk.py22050644editdlrm
test_format_stack.py42500644editdlrm
test_func_inspect.py89350644editdlrm
test_func_inspect_special_encoding.py1460644editdlrm
test_hashing.py160780644editdlrm
test_init.py4220644editdlrm
test_logger.py9850644editdlrm
test_memmapping.py421540644editdlrm
test_memory.py448100644editdlrm
test_missing_multiprocessing.py11230644editdlrm
test_module.py18320644editdlrm
test_my_exceptions.py20660644editdlrm
test_numpy_pickle.py387000644editdlrm
test_numpy_pickle_compat.py6240644editdlrm
test_numpy_pickle_utils.py4210644editdlrm
test_parallel.py596530644editdlrm
test_store_backends.py19420644editdlrm
test_testing.py24670644editdlrm
test_utils.py5840644editdlrm
__init__.py730644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/joblib/test/test_my_exceptions.py (2066B)
""" Test my automatically generate exceptions """ from joblib.my_exceptions import ( JoblibException, JoblibNameError, _mk_exception) class CustomException(Exception): def __init__(self, a, b, c, d): self.a, self.b, self.c, self.d = a, b, c, d class CustomException2(Exception): """A custom exception with a .args attribute Just to check that the JoblibException created from it has it args set correctly """ def __init__(self, a, *args): self.a = a self.args = args def test_inheritance(): assert isinstance(JoblibNameError(), NameError) assert isinstance(JoblibNameError(), JoblibException) assert (JoblibNameError is _mk_exception(NameError)[0]) def test_inheritance_special_cases(): # _mk_exception should transform Exception to JoblibException assert (_mk_exception(Exception)[0] is JoblibException) # Subclasses of JoblibException should be mapped to # them-selves by _mk_exception assert (_mk_exception(JoblibException)[0] is JoblibException) # Non-inheritable exception classes should be mapped to # JoblibException by _mk_exception. That can happen with classes # generated with SWIG. See # https://github.com/joblib/joblib/issues/269 for a concrete # example. non_inheritable_classes = [type(lambda: None), bool] for exception in non_inheritable_classes: assert (_mk_exception(exception)[0] is JoblibException) def test__mk_exception(): # Check that _mk_exception works on a bunch of different exceptions for klass in (Exception, TypeError, SyntaxError, ValueError, ImportError, CustomException, CustomException2): message = 'This message should be in the exception repr' exc = _mk_exception(klass)[0]( message, 'some', 'other', 'args', 'that are not', 'in the repr') exc_repr = repr(exc) assert isinstance(exc, klass) assert isinstance(exc, JoblibException) assert exc.__class__.__name__ in exc_repr assert message in exc_repr