Skip to content

fix(test_exceptions.py): move exception tests #11501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

colesmcintosh
Copy link
Collaborator

@colesmcintosh colesmcintosh commented Jun 6, 2025

Title

fix(test_exceptions.py): move exception tests

Relevant issues

Improves rate limiting error detection across different LLM providers by replacing basic string matching with comprehensive regex patterns.

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • I have added a screenshot of my new test passing locally
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

Type

🐛 Bug Fix

Changes

Summary

Move test_exceptions.py into tests/test_litellm/litellm_core_utils

What Changed

  • Moved test_exceptions.py into tests/test_litellm/litellm_core_utils

Why This Matters

  • to run test with GH actions

Testing

  • Existing test_fireworks_ai_exception_mapping test continues to pass
  • Verified with comprehensive test cases covering positive and negative scenarios
  • All rate limiting patterns detected correctly while avoiding false positives

Files Modified

  • test_exceptions.py into tests/test_litellm/litellm_core_utils

…ex patterns for improved accuracy. Fallback to original logic if regex fails. Update import statement for verbose_logger.
Copy link

vercel bot commented Jun 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2025 11:08pm

…ng regex patterns, relying on string checks instead. This change enhances performance and maintains functionality.
@colesmcintosh colesmcintosh changed the title Improve rate limit detection with regex patterns and move tests Move exception tests Jun 6, 2025
@colesmcintosh colesmcintosh changed the title Move exception tests fix(test_exceptions.py): move exception tests Jun 6, 2025
…exceptions.py` to streamline the codebase and improve readability.
…ary imports to improve code clarity and maintainability.
Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

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

changes requested pls.

@@ -5,7 +5,7 @@
import httpx

import litellm
from litellm._logging import verbose_logger
Copy link
Contributor

Choose a reason for hiding this comment

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

can we not change this file

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