Skip to content

Commit bfae4ec

Browse files
committed
Fix test_api.py to handle missing openai_client in CI environment
1 parent 82cd57d commit bfae4ec

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/unit/test_api.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ def mock_collection():
3030
@pytest.fixture(autouse=True, scope="module")
3131
def mock_dependencies():
3232
"""Mock API dependencies for all tests."""
33+
# Create openai_client if it doesn't exist
34+
if not hasattr(api, "openai_client"):
35+
api.openai_client = None
36+
3337
# Apply mock patches at module level
3438
with patch.object(api, "MOCK_EMBEDDINGS", True), patch.object(
3539
api, "verify_dependencies", return_value=None

0 commit comments

Comments
 (0)