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

Function import_all_modules

t/unit/conftest.py:351–364  ·  view source on GitHub ↗
(name=__name__, file=__file__,
                       skip=('celery.decorators',
                             'celery.task'))

Source from the content-addressed store, hash-verified

349
350
351def import_all_modules(name=__name__, file=__file__,
352 skip=('celery.decorators',
353 'celery.task')):
354 for module in find_distribution_modules(name, file):
355 if not module.startswith(skip):
356 try:
357 import_module(module)
358 except ImportError:
359 pass
360 except OSError as exc:
361 warnings.warn(UserWarning(
362 'Ignored error importing module {}: {!r}'.format(
363 module, exc,
364 )))
365
366
367@pytest.fixture

Callers 1

setup_sessionFunction · 0.85

Calls 3

warnMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected