Skip to content

fix: remove dead callable() check in parametrize test - #357

Closed
andrewwhitecdw wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
andrewwhitecdw:codequality/test-client-remove-dead-callable-check-in
Closed

fix: remove dead callable() check in parametrize test#357
andrewwhitecdw wants to merge 1 commit into
NVIDIA-NeMo:mainfrom
andrewwhitecdw:codequality/test-client-remove-dead-callable-check-in

Conversation

@andrewwhitecdw

@andrewwhitecdw andrewwhitecdw commented Aug 11, 2026

Copy link
Copy Markdown

fix: remove dead callable() check in parametrize test

Root cause

The test asserted assert callable(mutate) even though every parametrized case supplies a lambda. The assertion added no value and was flagged as dead code.

Fix

Drop the assert and call mutate(request) directly. All 18 parametrized cases still pass.

-    assert callable(mutate)
     mutate(request)

Testing

  • pytest tests/test_client.py::test_call_rejects_unsupported_normalized_fields -v: 18 passed
  • ruff check .: All checks passed

Contributor guidelines

  • DCO sign-off: included.
  • Squash: one commit.

Summary by CodeRabbit

  • Tests
    • Removed a redundant test assertion from the unsupported-fields test case.

Summary

Remove an assertion that duplicates what pytest's parametrize type annotation already enforces.

Root cause

The test asserted callable(mutate) even though every parametrized case supplies a lambda. The assertion added no value and was flagged as dead code.

Fix

Drop the assert and call mutate(request) directly. All 18 parametrized cases still pass.

Testing

- pytest tests/test_client.py::test_call_rejects_unsupported_normalized_fields -v: 18 passed

- ruff check .: All checks passed

Contributor guidelines

- DCO sign-off: included (Signed-off-by).

- Squash: one commit.

Fixes #2097

Signed-off-by: andrewwhitecdw <andrewwhitecdw@users.noreply.github.com>
@andrewwhitecdw
andrewwhitecdw requested a review from a team as a code owner August 11, 2026 15:25
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4bd2cf06-3727-432f-8162-cf15749a50d8

📥 Commits

Reviewing files that changed from the base of the PR and between fb3fc30 and 5c29202.

📒 Files selected for processing (1)
  • examples/experimental/litellm/tests/test_client.py
💤 Files with no reviewable changes (1)
  • examples/experimental/litellm/tests/test_client.py

Walkthrough

The unsupported-fields parameterized test now applies mutate directly. It no longer performs a redundant callable assertion.

Changes

Test Assertion Cleanup

Layer / File(s) Summary
Direct mutation application
examples/experimental/litellm/tests/test_client.py
The test removes the preliminary callable(mutate) assertion and applies the mutation directly.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

I nibbled one assertion away,
And left the test direct today.
The mutation runs with less delay,
While carrots cheer the cleaner way.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the removal of the redundant callable() check from the parametrized test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@ayushag-nv

Copy link
Copy Markdown
Contributor

I think there is no need for this PR. It is just asserting whether mutate is callable or not. I would keep it as it is.

@ayushag-nv ayushag-nv closed this Aug 13, 2026
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