From 568a8b1205ebc53856d9449e74d7ce0d58c6e2c8 Mon Sep 17 00:00:00 2001 From: Jeroen Ubbink Date: Tue, 25 Aug 2026 21:24:29 +0200 Subject: [PATCH] test(pricing): read the catalog through the test session only The provider helper called reinitialize_upstreams(), which re-reads the provider table through the global engine rather than the session the test was handed. On a developer machine that engine finds keys.db and the call is invisible; on a clean checkout there is no such database and every test in the file fails with "no such table: upstream_providers". Nothing here needs it: these tests call list_models() with the session directly and never route a request, so the proxy's cached upstreams are not part of what is under test. Dropping the call also stops the file mutating that global for whatever runs next. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_011cKHVF5LA7TR5QuYi6ErLM --- tests/integration/test_served_catalog_rate_backstop.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/integration/test_served_catalog_rate_backstop.py b/tests/integration/test_served_catalog_rate_backstop.py index 7819c017..4acee442 100644 --- a/tests/integration/test_served_catalog_rate_backstop.py +++ b/tests/integration/test_served_catalog_rate_backstop.py @@ -19,7 +19,6 @@ from sqlmodel.ext.asyncio.session import AsyncSession from routstr.core.db import ModelRow, UpstreamProviderRow from routstr.payment.models import list_models -from routstr.proxy import reinitialize_upstreams _ARCHITECTURE = json.dumps( { @@ -42,7 +41,6 @@ async def _make_provider(session: AsyncSession) -> int: session.add(provider) await session.commit() await session.refresh(provider) - await reinitialize_upstreams() assert provider.id is not None return provider.id