Skip to content

Commit

Permalink
dep injection try 3
Browse files Browse the repository at this point in the history
  • Loading branch information
azliu0 committed Apr 16, 2024
1 parent d0c0f75 commit 2552675
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import cast
from unittest.mock import patch

import openai
import psycopg2
import pytest
import redis
Expand Down Expand Up @@ -66,6 +67,7 @@ def redis_host():
@pytest.fixture(scope="session")
def mock_openai_chat_completion():
"""Mock the OpenAI chat completion API."""
openai.api_key = "dummy_key"
with patch("openai.chat.completions.create") as mock:
mock.return_value = ChatCompletion(
id="foo",
Expand Down

0 comments on commit 2552675

Please sign in to comment.