Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,30 @@

from __future__ import annotations

from typing import Generator
import pytest
from pytest_mock import MockerFixture, AsyncMockType

type AgentFixtures = Generator[
tuple[
AsyncMockType,
AsyncMockType,
],
None,
None,
]


@pytest.fixture(name="prepare_agent_mocks", scope="function")
def prepare_agent_mocks_fixture(mocker):
def prepare_agent_mocks_fixture(
mocker: MockerFixture,
) -> AgentFixtures:
"""Prepare for mock for the LLM agent.

Provides common mocks for AsyncLlamaStackClient and AsyncAgent
with proper agent_id setup to avoid initialization errors.

Returns:
Yields:
tuple: (mock_client, mock_agent)
"""
mock_client = mocker.AsyncMock()
Expand Down
Loading