mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-19 08:18:15 +00:00
- Reset mock call counts at start of test to ensure clean state - Add span method to mock trace to handle log_provider_specific_information_as_span calls - Re-establish mock chain before test call to ensure fresh state - Add exception handling to catch and report errors during test execution - Add verification that trace was called before checking generation This should fix the flaky test that was failing intermittently with 'Expected generation to have been called once. Called 0 times.'
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