Files
litellm/tests/test_litellm
Alexsander Hamir 1393c76578 [Fix] CI/CD - Fix failing proxy and core integration tests (#17926)
* Fix: Add prisma generate to proxy tests CI job

- Add prisma generate command before pytest in litellm_mapped_tests_proxy job
- Fixes 3 test failures: test_health_liveliness_endpoint, test_health_liveness_endpoint, test_health_readiness
- Matches pattern used in litellm_mapped_enterprise_tests job

* Fix: Add missing prompt_spec parameter to TestCustomPromptManagement

- Add prompt_spec parameter to get_chat_completion_prompt() method signature
- Fixes 2 test failures: test_custom_prompt_management_with_prompt_id and test_custom_prompt_management_with_prompt_id_and_prompt_variables
- Aligns test mock with base class method signature from CustomPromptManagement

* Fix: Handle string datetime values in OpenTelemetry timestamp conversion

- Add _to_timestamp helper to handle datetime, float, and string inputs
- Fixes test_handle_success_spans_and_metrics failure
- Handles string datetime format from JSON deserialization (e.g. '2025-06-22 10:59:08.399523')
- Applied to all timestamp conversions in OpenTelemetry metrics methods

* Fix OpenTelemetry timestamp parsing to handle datetime strings with/without microseconds
2025-12-13 10:11:01 -08:00
..

Testing for litellm/

This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.

The point of this is to:

  1. Increase test coverage of litellm/
  2. 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.py maps to litellm/proxy/caching_routes.py
  • test_<filename>.py maps to litellm/<filename>.py