Skip to content

Test file supression - #110

Closed
vansh-deepsource wants to merge 3 commits into
masterfrom
test-file-supression
Closed

Test file supression#110
vansh-deepsource wants to merge 3 commits into
masterfrom
test-file-supression

Conversation

@vansh-deepsource

Copy link
Copy Markdown
Collaborator

No description provided.

vansh-deepsource and others added 3 commits June 8, 2026 17:33
Mirrors the FP cases (FP-46826/46827/46828/46829/46831) as Python test
files so the permissive test-file rubric can be exercised end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Defects that should remain reportable even when AI Review applies the
permissive test-file rubric from ENG-4588 (mutable default arg, SQL
injection, identity-vs-equality, file handle leak, off-by-one,
unreachable code, assert-for-auth).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Covers noqa, nosec, skipcq, and pylint disable styles — mix of bare
and code-scoped — so suppression-handling can be exercised against
the permissive test-file rubric.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@deepsource-development

deepsource-development Bot commented Jun 9, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 9d1323c...cf6500f on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade  

Focus Area: Reliability
Security  

Reliability  

Complexity  

Hygiene  

Feedback

Test intent vs. test safety

  • The two reliability issues are about tests that can’t actually fail in meaningful ways: catching Exception around assertions and asserting on a constant both give a green check even when behavior is wrong.
  • Given how thorough and isolated the tests otherwise are, it’s worth making sure every test will reliably go red when behavior regresses.

Code Review Summary

Analyzer Status Updated (UTC) Details
Ansible Jun 9, 2026 3:32a.m. Review ↗
Helm Jun 9, 2026 3:32a.m. Review ↗
Python Jun 9, 2026 3:32a.m. Review ↗
Secrets Jun 9, 2026 3:32a.m. Review ↗

f = open("/tmp/route_dump.txt", "w") # skipcq: PYL-R1732
for method, path in ROUTES:
f.write(f"{method} {path}\n")
self.assertTrue(True)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Passing constant to `assertTrue` yields meaningless test


Passing a constant value like True to assertTrue causes the assertion to always pass, defeating the purpose of a test since no real condition is checked. This results in tests that give false confidence by never failing.

Replace the constant argument with an actual condition or use the appropriate assertion method like assertEqual for value comparisons to ensure meaningful test validations.


def test_first_three_routes_are_admin_scoped(self):
for i in range(len(PROTECTED_ROUTES) + 1): # pylint: disable
method, path = PROTECTED_ROUTES[i]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Unused `method` variable adds unnecessary code clutter


The variable method is declared and assigned from PROTECTED_ROUTES[i] but never used afterwards, which wastes resources and makes the code less clear. Unused variables make the code harder to read and maintain.
Remove the method variable or rename it to _ to indicate intentional unused usage and clean the codebase.

Comment on lines +37 to +40
try:
self.assertGreater(len(ROUTES), 0)
except Exception:
pass

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

`except Exception` masks failed assertions


test_route_table_is_non_empty suppresses all assertion failures. A broken route table can pass silently, reducing test signal and allowing regressions to merge.

Remove the try/except and assert directly with self.assertGreater(len(ROUTES), 0) so failures are reported

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.

1 participant