From b962fa90e21af56aa78de116e606414a8f3ce388 Mon Sep 17 00:00:00 2001 From: yucheng Date: Mon, 14 Sep 2026 21:13:50 +0000 Subject: [PATCH] test(langfuse): isolate the e2e sync test from cached clients and log the real sdk major Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/integrations/langfuse/langfuse.py | 2 +- tests/logging_callback_tests/test_langfuse_unit_tests.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/litellm/integrations/langfuse/langfuse.py b/litellm/integrations/langfuse/langfuse.py index ca463feb985..45dd445d9df 100644 --- a/litellm/integrations/langfuse/langfuse.py +++ b/litellm/integrations/langfuse/langfuse.py @@ -625,7 +625,7 @@ class LangFuseLogger: level: str, litellm_call_id: str | None, ) -> tuple: - verbose_logger.debug("Langfuse Layer Logging - logging to langfuse v2") + verbose_logger.debug("Langfuse Layer Logging - logging to langfuse via sdk v%s", self.langfuse_sdk_version) try: standard_logging_object: Final[StandardLoggingPayload | None] = cast( diff --git a/tests/logging_callback_tests/test_langfuse_unit_tests.py b/tests/logging_callback_tests/test_langfuse_unit_tests.py index 6e44840a535..291a7e75d40 100644 --- a/tests/logging_callback_tests/test_langfuse_unit_tests.py +++ b/tests/logging_callback_tests/test_langfuse_unit_tests.py @@ -318,6 +318,8 @@ def test_langfuse_e2e_sync(monkeypatch): import litellm from litellm import completion from litellm.integrations.langfuse.langfuse import LangFuseLogger + from litellm.integrations.langfuse.langfuse_prompt_management import langfuse_client_init + from litellm.litellm_core_utils import litellm_logging received_paths = [] @@ -338,7 +340,10 @@ def test_langfuse_e2e_sync(monkeypatch): monkeypatch.setenv("LANGFUSE_PUBLIC_KEY", "pk-e2e-sync") monkeypatch.setenv("LANGFUSE_SECRET_KEY", "sk-e2e-sync") monkeypatch.setattr(litellm, "success_callback", ["langfuse"]) - monkeypatch.setattr(litellm, "_langfuse_logger_cache", {}, raising=False) + monkeypatch.setattr(litellm_logging, "langFuseLogger", None) + monkeypatch.setattr(litellm_logging, "in_memory_dynamic_logger_cache", DynamicLoggingCache()) + monkeypatch.setattr(litellm_logging, "_in_memory_loggers", []) + langfuse_client_init.cache_clear() try: completion(