Skip to content

Commit 82cd57d

Browse files
committed
Fix unit tests by correctly patching openai_client
1 parent 9e05e40 commit 82cd57d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/unit/test_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def mock_dependencies():
3333
# Apply mock patches at module level
3434
with patch.object(api, "MOCK_EMBEDDINGS", True), patch.object(
3535
api, "verify_dependencies", return_value=None
36-
), patch("api.get_collection"), patch("api.mock_embedding"), patch("api.openai_client"):
36+
), patch("api.get_collection"), patch("api.mock_embedding"), patch.object(
37+
api, "openai_client", MagicMock()
38+
):
3739
yield
3840

3941

0 commit comments

Comments
 (0)