refactor: update test fixtures and remove unused environment variables#233
Merged
refactor: update test fixtures and remove unused environment variables#233
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the test fixture infrastructure to improve test isolation and database transaction handling. It introduces a new db_session fixture with explicit transaction management and updates test files to use direct database manipulation where appropriate.
Changes:
- Introduced per-test
db_sessionfixture with transaction rollback for improved test isolation - Updated test fixtures to use explicit dependency overrides with the new session management
- Removed unused
POSTGRES_TEST_USERenvironment variable from configuration - Disabled SQL echo logging for the test engine to reduce test output verbosity
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/conftest.py | Refactored test fixtures: added db_session fixture with transaction management, made start_db autouse, updated client fixture to use dependency override with db_session |
| tests/api/test_stuff.py | Updated tests to accept db_session parameter and use direct database manipulation instead of HTTP calls for test data setup |
| app/database.py | Disabled SQL echo logging (echo=False) for test engine to reduce verbosity during test execution |
| app/config.py | Removed unused POSTGRES_TEST_USER field from Settings class |
| .env | Removed unused POSTGRES_TEST_USER environment variable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.