mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix: correct patch path in langfuse test for MAX_LANGFUSE_INITIALIZED_CLIENTS (#13192)
The test was failing because it was trying to patch MAX_LANGFUSE_INITIALIZED_CLIENTS at the wrong path. The constant is imported from litellm.constants into the langfuse module namespace, so we need to use patch.object on the imported module reference. Changes: - Import langfuse module explicitly for patching - Use patch.object instead of patch string path - This fixes the AttributeError that was causing CI failures
This commit is contained in:
parent
56fc0cf374
commit
0666ede8e3
1 changed files with 2 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ from unittest.mock import patch
|
|||
import pytest
|
||||
|
||||
import litellm
|
||||
from litellm.integrations.langfuse import langfuse as langfuse_module
|
||||
from litellm.integrations.langfuse.langfuse import LangFuseLogger
|
||||
|
||||
|
||||
|
|
@ -20,9 +21,7 @@ def test_max_langfuse_clients_limit():
|
|||
Test that the max langfuse clients limit is respected when initializing multiple clients
|
||||
"""
|
||||
# Set max clients to 2 for testing
|
||||
with patch(
|
||||
"litellm.integrations.langfuse.langfuse.MAX_LANGFUSE_INITIALIZED_CLIENTS", 2
|
||||
):
|
||||
with patch.object(langfuse_module, "MAX_LANGFUSE_INITIALIZED_CLIENTS", 2):
|
||||
# Reset the counter
|
||||
litellm.initialized_langfuse_clients = 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue