From a4bdbcaca4d87131ff9bee8f37cb652dbf2b92ee Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 21 Sep 2026 14:21:20 -0400 Subject: [PATCH] test: import the placement task module so its names reach celery.tasks (4246) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three registration assertions failed: a task name only enters `celery.tasks` when its module is imported, and nothing in the test process imported `library_placement`. The API routes import it lazily inside the handlers, and the registration test runs before any handler test triggers that. `include=[...]` is what gets the module imported in a real WORKER, so production registration was never in question — the test was asserting something only observable after an import it never performed. test_tasks_admin already carries the convention verbatim (`import backend.app.tasks.admin # noqa: F401 — register tasks`); I wrote the assertion from what I meant instead of copying the idiom next to it. Same mistake shape as the commit-vs-flush bounce one commit ago: the pattern was already in the suite both times. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01LVjrnpQjRgHdvq95rASoiR --- tests/test_api_placement.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_api_placement.py b/tests/test_api_placement.py index d9f0f49..3fd56b4 100644 --- a/tests/test_api_placement.py +++ b/tests/test_api_placement.py @@ -8,6 +8,7 @@ endpoints gate on run state, and that a list response stays small. import pytest from sqlalchemy import select +import backend.app.tasks.library_placement # noqa: F401 — register tasks from backend.app.celery_app import celery from backend.app.models import Artist, LibraryPlacementRun