Skip to content

Commit ef1701c

Browse files
committed
push
1 parent 1d535c3 commit ef1701c

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

tests/test_prompt_atexit.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import pytest
21
import subprocess
32

3+
import pytest
4+
45

56
@pytest.mark.timeout(10)
67
def test_prompts_atexit():
78
python_code = """
89
import time
910
import logging
10-
from langfuse.prompt_cache import PromptCache # assuming task_manager is the module name
1111
12-
logging.basicConfig(
13-
level=logging.DEBUG,
14-
format="%(asctime)s [%(levelname)s] %(message)s",
15-
handlers=[
16-
logging.StreamHandler()
17-
]
18-
)
12+
from langfuse.logger import langfuse_logger
13+
from langfuse._utils.prompt_cache import PromptCache
14+
15+
langfuse_logger.setLevel(logging.DEBUG)
16+
handler = logging.StreamHandler()
17+
handler.setLevel(logging.DEBUG)
18+
langfuse_logger.addHandler(handler)
1919
2020
print("Adding prompt cache", PromptCache)
2121
prompt_cache = PromptCache(max_prompt_refresh_workers=10)
@@ -61,15 +61,14 @@ def test_prompts_atexit_async():
6161
import time
6262
import asyncio
6363
import logging
64-
from langfuse.prompt_cache import PromptCache # assuming task_manager is the module name
65-
66-
logging.basicConfig(
67-
level=logging.DEBUG,
68-
format="%(asctime)s [%(levelname)s] %(message)s",
69-
handlers=[
70-
logging.StreamHandler()
71-
]
72-
)
64+
65+
from langfuse.logger import langfuse_logger
66+
from langfuse._utils.prompt_cache import PromptCache
67+
68+
langfuse_logger.setLevel(logging.DEBUG)
69+
handler = logging.StreamHandler()
70+
handler.setLevel(logging.DEBUG)
71+
langfuse_logger.addHandler(handler)
7372
7473
async def main():
7574
print("Adding prompt cache", PromptCache)

0 commit comments

Comments
 (0)