mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-04 18:27:10 +00:00
* fix(tests): Fix sendgrid email tests to properly mock httpx client The tests were potentially hitting the real SendGrid API because the mock was patching get_async_httpx_client() but the actual client could be cached or the mock timing could be off. Fix by directly replacing logger.async_httpx_client after instantiation, which guarantees the mock is used regardless of caching or initialization timing issues. Changes: - Replace mock_httpx_client fixture with simpler mock_async_client fixture - Directly inject mock client into logger instance after creation - Remove respx decorator (no longer needed with direct injection) - Simplify test structure while maintaining same assertions * fix(lint): remove unused imports from SendGrid test
Testing for litellm/
This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.
The point of this is to:
- Increase test coverage of
litellm/ - Make it easy for contributors to add tests for the
litellm/package and easily run tests without needing LLM API keys.
File name conventions
litellm/proxy/test_caching_routes.pymaps tolitellm/proxy/caching_routes.pytest_<filename>.pymaps tolitellm/<filename>.py