fix: remove dead callable() check in parametrize test - #357
Closed
andrewwhitecdw wants to merge 1 commit into
Closed
fix: remove dead callable() check in parametrize test#357andrewwhitecdw wants to merge 1 commit into
andrewwhitecdw wants to merge 1 commit into
Conversation
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>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
WalkthroughThe unsupported-fields parameterized test now applies ChangesTest Assertion Cleanup
Estimated code review effort: 1 (Trivial) | ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
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. |
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.
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 passedruff check .: All checks passedContributor guidelines
Summary by CodeRabbit