Skip to content

Commit 0e77384

Browse files
nsgdsclaude
andcommitted
fix(test): ensure model_endpoints table exists for in-memory CI run
CI runs bare pytest with DATABASE_URL=sqlite:///:memory: (per conftest); the in-memory model_endpoints table is not reliably present on the active connection by the time the same-base-url test seeds rows (a prior test in the full suite can recycle the singleton connection). Call Base.metadata.create_all(bind=engine) at the top of the test (no-op when the table already exists, e.g. in the Docker image where setup.py created the DB). Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 15337d7 commit 0e77384

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_reasoning_control.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ class TestEndpointResolution:
6565

6666
def test_same_base_url_disambiguates_by_model(self):
6767
import json
68-
from core.database import SessionLocal, ModelEndpoint
68+
from core.database import SessionLocal, ModelEndpoint, Base, engine
69+
# CI runs bare pytest against an in-memory SQLite (see conftest); the
70+
# model_endpoints table may not be present on the active connection by the
71+
# time this runs, so ensure it exists before seeding (no-op if present).
72+
Base.metadata.create_all(bind=engine)
6973
url = "http://shared-rc-test.invalid:9911/v1"
7074
ids = ["rc-test-a", "rc-test-b"]
7175
db = SessionLocal()

0 commit comments

Comments
 (0)