From 13b9d8ef1017df95b6859da0b8919d678baac2c1 Mon Sep 17 00:00:00 2001 From: AsherLucas Date: Thu, 29 Oct 2026 11:36:19 +0800 Subject: [PATCH] test(prompt): use explicit test credentials in test_prompt fixture Fixes #1976: CONTRIBUTING says unit tests need no running server, but the langfuse fixture called Langfuse() with no arguments, so without LANGFUSE_* env vars the client was disabled and setting .api raised AttributeError. Use the dummy credentials CI already uses so the fixture initializes and the 18 erroring tests pass on a fresh clone. --- 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: