test(integration): seed the live image reference once per session

- create_app(TESTING=True) skips the Redis bootstrap, and the loader no longer fetches at import, so the end-to-end suite advertised and requested models against an empty reference; a session-scoped autouse fixture now runs the direct loader once, restoring the process-wide reference those tests rely on
This commit is contained in:
tazlin committed 2026-08-30 11:17:19 -04:00
1 parent f374fed8bd
commit 6ac79b231f
1 file changed
+13
+13
View File
@@ -297,3 +297,16 @@ def api_key(app: Flask) -> str:
user.refresh_cache()
return provisioned_api_key
@pytest.fixture(scope="session", autouse=True)
def _live_image_reference() -> None:
"""Load the live image reference once for the whole end-to-end run.
``create_app(TESTING=True)`` skips the Redis bootstrap, so the direct loader fills the
process-wide reference these tests advertise and request models from.
"""
from horde.model_reference import model_reference
if not model_reference.reference:
model_reference.call_function()