Skip to content

Commit 8c68d69

Browse files
committed
fix: mock get_client in JSON repair tests for CI without LLM_API_KEY
1 parent cc078e1 commit 8c68d69

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/test_json_repair.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
from unittest.mock import AsyncMock, patch
1+
from unittest.mock import AsyncMock, MagicMock, patch
22

33
import pytest
44
from pydantic import BaseModel
55

66
from backend.utils.llm_client import structured_completion
77

88

9+
@pytest.fixture(autouse=True)
10+
def _mock_llm_client():
11+
with patch("backend.utils.llm_client.get_client", return_value=MagicMock()):
12+
yield
13+
14+
915
class SimpleModel(BaseModel):
1016
name: str
1117
value: int

0 commit comments

Comments
 (0)