From 27fe43d517a2a560be8edd1e5c0cfaec6e80f969 Mon Sep 17 00:00:00 2001 From: shantanu Date: Sun, 11 Oct 2026 17:11:34 +0530 Subject: [PATCH 1/2] test: make prompt unit test fixture independent of LANGFUSE_* env vars --- tests/unit/test_prompt.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/unit/test_prompt.py b/tests/unit/test_prompt.py index eadfb8221..54214dc6d 100644 --- a/tests/unit/test_prompt.py +++ b/tests/unit/test_prompt.py @@ -129,7 +129,11 @@ def test_compile_with_placeholders( def langfuse(): from langfuse._client.resource_manager import LangfuseResourceManager - langfuse_instance = Langfuse() + langfuse_instance = Langfuse( + public_key="pk-lf-test", + secret_key="sk-lf-test", + base_url="http://localhost:3000", + ) langfuse_instance.api = Mock() if langfuse_instance._resources is None: From 848fcf09e259b4667c77478436185dadfeab1f44 Mon Sep 17 00:00:00 2001 From: shantanu Date: Sat, 17 Oct 2026 10:40:45 +0530 Subject: [PATCH 2/2] refactor(tests): simplify langfuse fixture by removing unnecessary resource manager initialization --- tests/unit/test_prompt.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tests/unit/test_prompt.py b/tests/unit/test_prompt.py index 54214dc6d..598deaec5 100644 --- a/tests/unit/test_prompt.py +++ b/tests/unit/test_prompt.py @@ -127,8 +127,6 @@ def test_compile_with_placeholders( @pytest.fixture def langfuse(): - from langfuse._client.resource_manager import LangfuseResourceManager - langfuse_instance = Langfuse( public_key="pk-lf-test", secret_key="sk-lf-test", @@ -136,10 +134,6 @@ def langfuse(): ) langfuse_instance.api = Mock() - if langfuse_instance._resources is None: - langfuse_instance._resources = Mock(spec=LangfuseResourceManager) - langfuse_instance._resources.prompt_cache = PromptCache() - return langfuse_instance