From 52fc66cb5ff19bf0def001ae50acc1b465a0b977 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Thu, 12 Nov 2026 23:34:46 +0100 Subject: fix(core): decouple task imports from app initialization Keep stable lazy task handles that register against the active Huey backend so modules can be imported before app creation and survive backend reinitialization. Separate package metadata and the shared blueprint from application startup to remove import-order dependencies and keep build-time version lookup lightweight. --- tests/tasks/test_scanner.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'tests/tasks/test_scanner.py') diff --git a/tests/tasks/test_scanner.py b/tests/tasks/test_scanner.py index d11b3f2..c0b9223 100644 --- a/tests/tasks/test_scanner.py +++ b/tests/tasks/test_scanner.py @@ -42,8 +42,7 @@ def test_manual_scan_retries_when_periodic_scan_holds_lock( app: Flask, scanner_module: ModuleType ) -> None: with app.app_context(): - # Import-time decorators previously captured an old backend here, - # making this test pass or fail depending on module import order. + # A task imported earlier must still use the reinitialized backend. previous_backend = scanner_module.huey.huey scanner_module.huey.init_app(app) assert scanner_module.huey.huey is not previous_backend -- cgit v1.3.1