test: Address unreachable statement warnings in test cases#998
Open
Kanchan-Microsoft wants to merge 1 commit into
Open
test: Address unreachable statement warnings in test cases#998Kanchan-Microsoft wants to merge 1 commit into
Kanchan-Microsoft wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <copilot@github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Python unit tests to suppress specific LGTM/CodeQL analyzer warnings (unreachable statement and statement-has-no-effect) without changing test behavior.
Changes:
- Added
# lgtm[py/statement-has-no-effect]suppressions onawait taskstatements in cancellation-related async tests. - Added
# lgtm[py/unreachable-statement]suppression on a post-exception assertion verifying cleanup in an async context-manager test.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tests/backend/v4/config/test_settings.py | Adds LGTM suppression comments to two await task lines inside assertRaises blocks in async cancellation tests. |
| src/tests/backend/common/database/test_database_base.py | Adds an LGTM suppression comment to an assertion verifying close() is called after an exception in an async with block. |
💡 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.
Purpose
This pull request adds code analysis suppression comments to unit tests to address lgtm warnings without changing the test logic.
Code analysis suppressions:
# lgtm[py/unreachable-statement]to an assertion intest_database_base.pyto suppress an unreachable statement warning.# lgtm[py/statement-has-no-effect]to twoawait taskstatements intest_settings.pyto suppress statement-has-no-effect warnings. [1] [2]Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information