66
77from fastapi .testclient import TestClient
88
9+ from app .infra .db import get_session_factory
910from app .models import Run , new_id
10- from app .models .db import get_session_factory
1111
1212
1313def _utcnow () -> datetime :
@@ -230,8 +230,8 @@ def test_inactive_user_rejected(self, client: TestClient) -> None:
230230 import tempfile
231231
232232 from app .infra .config import get_settings
233+ from app .infra .db import get_session_factory
233234 from app .models import User
234- from app .models .db import get_session_factory
235235
236236 db = get_session_factory ()()
237237 try :
@@ -252,8 +252,8 @@ def test_inactive_user_rejected(self, client: TestClient) -> None:
252252
253253 def test_decrypt_roundtrip (self , client : TestClient , auth_headers : dict ) -> None :
254254 from app .infra import secrets_store
255+ from app .infra .db import get_session_factory
255256 from app .models import Secret
256- from app .models .db import get_session_factory
257257
258258 client .put ("/secrets/KEY" , json = {"name" : "KEY" , "value" : "plain" }, headers = auth_headers )
259259 db = get_session_factory ()()
@@ -277,8 +277,8 @@ def test_empty_summary(self, client: TestClient, auth_headers: dict) -> None:
277277 }
278278
279279 def test_summary_after_run (self , client : TestClient , auth_headers : dict ) -> None :
280+ from app .infra .db import get_session_factory
280281 from app .models import Conversation , UsageEvent , new_id
281- from app .models .db import get_session_factory
282282
283283 conversation_id = client .post (
284284 "/conversations" , json = {"title" : "bill" }, headers = auth_headers
0 commit comments