style: use SQLAlchemy 2.0 select() in sync test helpers
Match the select()/scalars() convention already used throughout app/db/repositories.py instead of the legacy Query API. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
from sqlalchemy import select
|
||||
|
||||
from app.db.models import ActivityStatus, SyncRun, SyncRunStatus, SyncUser
|
||||
|
||||
@@ -78,7 +79,7 @@ async def test_sync_run_repository_wiring_records_run(manager, seeded_user: Sync
|
||||
await manager.sync_user(seeded_user.id)
|
||||
|
||||
with session_factory() as session:
|
||||
runs = session.query(SyncRun).filter_by(user_id=seeded_user.id).all()
|
||||
runs = list(session.scalars(select(SyncRun).where(SyncRun.user_id == seeded_user.id)))
|
||||
assert len(runs) == 1
|
||||
run = runs[0]
|
||||
assert run.status == SyncRunStatus.SUCCESS
|
||||
|
||||
Reference in New Issue
Block a user