From 717ceb4b5acc25b0709b856419c9ae4f72140894 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 20 May 2026 21:20:30 -0400 Subject: [PATCH] fix(fc3c): explicit import of download task module in registration test Co-Authored-By: Claude Opus 4.7 (1M context) --- tests/test_download_source_task.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/test_download_source_task.py b/tests/test_download_source_task.py index e625d7b..2a1a946 100644 --- a/tests/test_download_source_task.py +++ b/tests/test_download_source_task.py @@ -1,11 +1,17 @@ -"""Smoke test that the Celery task is registered and routed correctly.""" +"""Smoke test that the FC-3c Celery task is registered and routed correctly. +Mirrors test_tasks_register.py — Celery's `include=[...]` is lazy, so +the task module must be imported explicitly to trigger registration. +""" + +# Side-effect import: the @celery.task decorator on download_source fires +# at module import time and registers the task with the global instance. +import backend.app.tasks.download # noqa: F401 from backend.app.celery_app import celery def test_download_source_is_registered(): - name = "backend.app.tasks.download.download_source" - assert name in celery.tasks + assert "backend.app.tasks.download.download_source" in celery.tasks def test_download_source_routes_to_download_queue():