def test_static_isinstance(self): self.assertTrue( static_isinstance(obj=list(), obj_type=['builtins.list', '__builtin__.list'])) self.assertTrue( any([ static_isinstance(obj=list(), obj_type='builtins.list'), static_isinstance(obj=list(), obj_type='__builtin__.list') ])) self.assertRaises(TypeError, static_isinstance, list(), 1)
def test_static_isinstance(self): self.assertTrue( static_isinstance( obj=list(), obj_type=["builtins.list", "__builtin__.list"] ) ) self.assertTrue( any( [ static_isinstance(obj=list(), obj_type="builtins.list"), static_isinstance(obj=list(), obj_type="__builtin__.list"), ] ) ) self.assertRaises(TypeError, static_isinstance, list(), 1)
def _extend_job_dict(job_dict): for d in [{name: obj.__module__ for name, obj in inspect.getmembers(importlib.import_module(name)) if inspect.isclass(obj) and static_isinstance(obj, 'pyiron.base.job.generic.GenericJob')} for finder, name, ispkg in pkgutil.iter_modules() if name.startswith('pyiron_')]: job_dict.update(d) return job_dict