MCPcopy Create free account
hub / github.com/celery/celery / import_hook

Method import_hook

t/unit/security/test_security.py:161–164  ·  view source on GitHub ↗
(name, *args, **kwargs)

Source from the content-addressed store, hash-verified

159 _import = builtins.__import__
160
161 def import_hook(name, *args, **kwargs):
162 if name == 'cryptography':
163 raise ImportError
164 return _import(name, *args, **kwargs)
165
166 builtins.__import__ = import_hook
167 with pytest.raises(ImproperlyConfigured):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected