Skip to content

refactor: build the test session with create_session - #54

Merged
lesnik512 merged 1 commit into
mainfrom
refactor/fixture-uses-create-session
Sep 28, 2026
Merged

lesnik512 merged 1 commit into
mainfrom
refactor/fixture-uses-create-session

Conversation

@lesnik512

Copy link
Copy Markdown
Member

The db_session fixture in tests/conftest.py built its AsyncSession by hand with the same arguments as app.resources.db.create_session, so the two could drift apart. It now calls create_session(connection).

create_session's parameter is widened to sa.AsyncEngine | sa.AsyncConnection. That makes the annotation match what already happens at runtime: tests override Dependencies.dynamic_engine with an AsyncConnection, so the DI container already passes a connection into create_session.

No behaviour change. just lint (ruff, ty) and just test pass: 31 tests, 100% coverage.

@lesnik512
lesnik512 merged commit 0cbe3fe into main Sep 28, 2026
2 checks passed
@lesnik512
lesnik512 deleted the refactor/fixture-uses-create-session branch September 28, 2026 06:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant