Changeset View
Changeset View
Standalone View
Standalone View
swh/scheduler/tests/conftest.py
Show All 28 Lines | |||||
@pytest.fixture(scope='session') | @pytest.fixture(scope='session') | ||||
def celery_enable_logging(): | def celery_enable_logging(): | ||||
return True | return True | ||||
@pytest.fixture(scope='session') | @pytest.fixture(scope='session') | ||||
def celery_includes(): | def celery_includes(): | ||||
return [ | task_modules = [ | ||||
'swh.scheduler.tests.tasks', | 'swh.scheduler.tests.tasks', | ||||
] | ] | ||||
import pkg_resources | |||||
vlorentz: Why not toplevel? | |||||
ardumontUnsubmitted Not Done Inline ActionsI think the rationale is to implement a poor man's lazy policy ;) ardumont: I think the rationale is to implement a `poor man's lazy policy` ;) | |||||
vlorentzUnsubmitted Not Done Inline ActionsIt's a test fixture, it will always run if that file is imported vlorentz: It's a test fixture, it will always run if that file is imported | |||||
ardumontUnsubmitted Not Done Inline Actionsheh, sounds about right indeed. ardumont: heh, sounds about right indeed. | |||||
douarddaAuthorUnsubmitted Done Inline Actions
Why toplevel? douardda: > Why not toplevel?
Why toplevel? | |||||
vlorentzUnsubmitted Not Done Inline ActionsBecause imports should always be at the toplevel unless there's a reason not to. vlorentz: Because imports should always be at the toplevel unless there's a reason not to. | |||||
for entrypoint in pkg_resources.iter_entry_points('swh.workers'): | |||||
task_modules.append(entrypoint.load()()['tasks']) | |||||
return task_modules | |||||
@pytest.fixture(scope='session') | @pytest.fixture(scope='session') | ||||
def celery_parameters(): | def celery_parameters(): | ||||
return { | return { | ||||
'task_cls': 'swh.scheduler.task:SWHTask', | 'task_cls': 'swh.scheduler.task:SWHTask', | ||||
} | } | ||||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |
Why not toplevel?