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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011cKHVF5LA7TR5QuYi6ErLM
This commit is contained in:
Jeroen Ubbink
2026-08-25 21:24:29 +02:00
co-authored by Claude Opus 5
parent fec229e1f4
commit 568a8b1205
@@ -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