test(lint): clear the two PT011/PT012 violations left on the test tree - #37864
Conversation
|
@greptileai can you reply here with a score and why that score? |
|
Score: 5/5 This is a clean, minimal, correct fix. Here's why: PT011 fix ( PT012 fix ( Both changes are behavior-preserving (as confirmed by the passing test counts in the PR description), minimal in scope, and directly address the stated lint violations with no unrelated modifications. |
Greptile SummaryThis PR resolves the remaining PT011/PT012 test-tree lint violations without changing the tested behavior.
Confidence Score: 5/5The PR appears safe to merge because both lint-only test refactors preserve their prior assertions and execution behavior. The selected budget methods remain awaited exactly once inside the exception context, and the new regex performs the same case-insensitive budget substring check as the removed assertion.
|
| Filename | Overview |
|---|---|
| tests/proxy_unit_tests/test_unit_test_max_model_budget_limiter.py | Refactors the parametrized budget-limit test so the raises block contains one awaited statement while preserving branch selection, arguments, and exception assertions. |
| tests/proxy_unit_tests/test_user_api_key_auth.py | Expresses the existing case-insensitive budget-message check through pytest's match parameter while retaining the user-ID assertion. |
Reviews (1): Last reviewed commit: "test(lint): clear the two PT011/PT012 vi..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: a contributor rebases any branch onto litellm_internal_staging and the lint check fails on files they never touched
After: the same rebase gets a green lint check
uv run ruff check --config ruff-tests.toml testsreports All checks passedRelevant issues
The rules landed in #37731; these two violations were left behind on the tree it gated
Linear ticket
Pre-Submission checklist
Screenshots / Proof of Fix
Before (merge base 4307b34)
After (PR tip 349d55c)
The refusal test keeps asserting on the budget message via the match parameter and still checks the user id lands in the error