Skip to content

Commit 037c3dd

Browse files
authored
Merge pull request #725 from tisnik/conftest-type-hint
LCORE-740: Conftest type hint
2 parents 0b873a4 + 817ab8c commit 037c3dd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

tests/unit/conftest.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,30 @@
22

33
from __future__ import annotations
44

5+
from typing import Generator
56
import pytest
7+
from pytest_mock import MockerFixture, AsyncMockType
8+
9+
type AgentFixtures = Generator[
10+
tuple[
11+
AsyncMockType,
12+
AsyncMockType,
13+
],
14+
None,
15+
None,
16+
]
617

718

819
@pytest.fixture(name="prepare_agent_mocks", scope="function")
9-
def prepare_agent_mocks_fixture(mocker):
20+
def prepare_agent_mocks_fixture(
21+
mocker: MockerFixture,
22+
) -> AgentFixtures:
1023
"""Prepare for mock for the LLM agent.
1124
1225
Provides common mocks for AsyncLlamaStackClient and AsyncAgent
1326
with proper agent_id setup to avoid initialization errors.
1427
15-
Returns:
28+
Yields:
1629
tuple: (mock_client, mock_agent)
1730
"""
1831
mock_client = mocker.AsyncMock()

0 commit comments

Comments
 (0)