test(litellm): Replace mocks with httpx types in rate-limit test#5975
test(litellm): Replace mocks with httpx types in rate-limit test#5975alexander-alderman-webb wants to merge 6 commits intowebb/litellm/embedding-testsfrom
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Anthropic
Other
Internal Changes 🔧Litellm
Other
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 6.14s All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 14911 uncovered lines. Generated by Codecov Action |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 179f14b. Configure here.
| "model": "gpt-3.5-turbo", | ||
| "messages": messages, | ||
| } | ||
| client = OpenAI(api_key="z") |
There was a problem hiding this comment.
OpenAI client retries 429 causing unnecessary test delay
Low Severity
OpenAI(api_key="z") uses the default max_retries=2, so when the mock returns a 429 response, the OpenAI client will automatically retry twice with exponential backoff (~1.5 seconds of sleeping) before finally raising RateLimitError. The old test called _failure_callback directly and had no such delay. Creating the client with max_retries=0 would avoid unnecessary retries and keep the test fast.
Reviewed by Cursor Bugbot for commit 179f14b. Configure here.


Description
Replace mocks with
httpxtypes to avoid test failures when library internals change.Issues
Reminders
tox -e linters.feat:,fix:,ref:,meta:)