fix(tests): fix API test expectations, remove warnings, and clean async test structure#166
Open
Vishmayraj wants to merge 4 commits into
Open
fix(tests): fix API test expectations, remove warnings, and clean async test structure#166Vishmayraj wants to merge 4 commits into
Vishmayraj wants to merge 4 commits into
Conversation
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.
Summary
This PR improves the
api/testssuite by aligning tests with current endpoint behavior, removing warnings, and cleaning up async test implementations.Changes Included
test_create_user_unexpected_error_returns_400_without_detailsto match the currentcreate_userresponse behavior (400instead of500) while still verifying that internal exception details are not exposed.test_connection_always_closed_even_on_exceptionto properly simulate a post-acquisition failure path and validate cleanup behavior without coroutine/runtime warnings.test_set_role_sql_safety.py.test_set_role_sql_safety.pyto use nativepytest.mark.asyncio+awaitinstead ofasyncio.run(...).Result
Additional Note
The
api/testsdirectory is currently somewhat fragmented in structure and repeats setup logic (environment variables, path setup, fixtures). If helpful, I’d be happy to contribute a follow-up PR to gradually migrate these tests into the repository roottests/directory so they can shareconftest.py, common fixtures, and a more maintainable layout.