Skip to content

test: Address unreachable statement warnings in test cases#998

Open
Kanchan-Microsoft wants to merge 1 commit into
dev-v4from
code-qualityfix
Open

test: Address unreachable statement warnings in test cases#998
Kanchan-Microsoft wants to merge 1 commit into
dev-v4from
code-qualityfix

Conversation

@Kanchan-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

This pull request adds code analysis suppression comments to unit tests to address lgtm warnings without changing the test logic.

Code analysis suppressions:

  • Added # lgtm[py/unreachable-statement] to an assertion in test_database_base.py to suppress an unreachable statement warning.
  • Added # lgtm[py/statement-has-no-effect] to two await task statements in test_settings.py to suppress statement-has-no-effect warnings. [1] [2]

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

Co-authored-by: Copilot <copilot@github.com>
@github-actions
Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL305638987% 
report-only-changed-files is enabled. No files were changed during this commit :)

Tests Skipped Failures Errors Time
883 5 💤 0 ❌ 0 🔥 8.030s ⏱️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 on await task statements 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.

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.

2 participants