TLK-2622 Unit tests improvements #907
Merged
+66
−43
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.
Unit tests improvements
AI Description
This PR introduces several changes to the backend unit tests and configuration files, primarily focusing on database setup and test fixtures.
DATABASE_URL
in src/backend/pytest.ini has been updated to remove the database name, and a newignore::DeprecationWarning
has been added.sqlalchemy.url
value is now set only if it is not already set.engine
andsession_chat
fixtures in src/backend/tests/unit/conftest.py have been modified to use theworker_id
to create a unique test database for each worker. Thesession_client
andsession_client_chat
fixtures now accept thefastapi_app
fixture as an argument, and thefastapi_app
fixture has been added to create a session-scoped FastAPI app object.user
fixture in src/backend/tests/integration/routers/test_chat.py has been changed from function to session.</co: 5>make run-unit-tests-debug
tomake run-unit-tests
.create_app
function in src/backend/main.py and src/backend/pycharm_debug_main.py now includes a return type hint ofFastAPI
.