diff --git a/quetz/tasks/workers.py b/quetz/tasks/workers.py index d1b9bdfa..22aab922 100644 --- a/quetz/tasks/workers.py +++ b/quetz/tasks/workers.py @@ -139,7 +139,7 @@ def job_wrapper( pkgstore = kwargs.pop("pkgstore", None) auth = kwargs.pop("auth", None) session = kwargs.pop("session", None) - + kwargs.pop("dao", None) kwargs.pop("db", None) with get_session(config) as db: user_id: Optional[str] diff --git a/quetz/tests/test_jobs.py b/quetz/tests/test_jobs.py index b79ae37d..8261ba95 100644 --- a/quetz/tests/test_jobs.py +++ b/quetz/tests/test_jobs.py @@ -866,9 +866,13 @@ def sync_supervisor(db, dao, config): @pytest.fixture def mock_action(mocker): - func = mocker.Mock() + m = mocker.Mock() + + def func(*args, **kwargs): + m(*args, **kwargs) + mocker.patch("quetz.jobs.handlers.JOB_HANDLERS", {"test_action": func}) - return func + return m def test_update_job_status(sync_supervisor, db, action_job):