Skip to content

Commit

Permalink
Fixed flake8 errors with openai module
Browse files Browse the repository at this point in the history
  • Loading branch information
bsuryadevara committed Jan 3, 2024
1 parent 211d66f commit 363e2b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ def mock_openai_fixture(chat_completion):

@pytest.mark.usefixtures("openai")
@pytest.fixture(name="mock_async_openai")
def mock_async_openai_fixture(chat_completion:):
def mock_async_openai_fixture(chat_completion):
with mock.patch("openai.AsyncOpenAI") as mock_async_openai:
mock_async_openai_instance = mock.MagicMock()
mock_create = mock.AsyncMock()
Expand Down
11 changes: 5 additions & 6 deletions tests/llm/services/test_llm_service_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ def test_completion_pipe_nemo(


@pytest.mark.use_python
def test_completion_pipe_openai(
config: Config,
chat_completion,
mock_async_openai: mock.MagicMock,
country_prompts: list[str],
capital_responses: list[str]):
def test_completion_pipe_openai(config: Config,
chat_completion,
mock_async_openai: mock.MagicMock,
country_prompts: list[str],
capital_responses: list[str]):

chat_completions = []
for response in capital_responses:
Expand Down
17 changes: 8 additions & 9 deletions tests/llm/test_rag_standalone_pipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,14 @@ def test_rag_standalone_pipe_nemo(
@pytest.mark.use_cudf
@pytest.mark.parametrize("repeat_count", [5])
@pytest.mark.import_mod(os.path.join(TEST_DIRS.examples_dir, 'llm/common/utils.py'))
def test_rag_standalone_pipe_openai(
config: Config,
chat_completion,
mock_openai: mock.MagicMock,
mock_async_openai: mock.MagicMock,
dataset: DatasetManager,
milvus_server_uri: str,
repeat_count: int,
import_mod: types.ModuleType):
def test_rag_standalone_pipe_openai(config: Config,
chat_completion,
mock_openai: mock.MagicMock,
mock_async_openai: mock.MagicMock,
dataset: DatasetManager,
milvus_server_uri: str,
repeat_count: int,
import_mod: types.ModuleType):

chat_completions = []
for _ in range(repeat_count):
Expand Down

0 comments on commit 363e2b9

Please sign in to comment.