mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-29 16:22:08 +00:00
* Fix test_log_langfuse_v2_handles_null_usage_values test failure The test was failing because the logger's Langfuse client wasn't properly mocked. Even though sys.modules was mocked, the logger's __init__ method creates its own Langfuse client instance that wasn't using the test's mock. Changes: - Explicitly set logger.Langfuse to the mock client after initialization - Set logger.langfuse_sdk_version to ensure _supports_* methods work correctly - Added mock_langfuse_client.client attribute to prevent errors during init - Added trace_id to mock_langfuse_generation for proper return value handling - Removed redundant mock setup code This ensures the test can properly verify that _log_langfuse_v2 correctly converts None usage values to 0 by allowing the mock's generation method to be called and asserted. Fixes: AssertionError: Expected 'generation' to have been called once. Called 0 times.
In total litellm runs 1000+ tests
[02/20/2025] Update:
To make it easier to contribute and map what behavior is tested,
we've started mapping the litellm directory in tests/test_litellm
This folder can only run mock tests.