tests: allow passing observers to run_test()

This commit is contained in:
Aleix Conchillo Flaqué
2025-05-12 17:53:02 -07:00
parent 12d49a9b9d
commit f800e35ccb
2 changed files with 7 additions and 1 deletions

View File

@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- Allow passing observers to `run_test()` while running unit tests.
### Changed
- `GoogleLLMService` has been updated to use `google-genai` instead of the

View File

@@ -6,7 +6,7 @@
import asyncio
from dataclasses import dataclass
from typing import Any, Awaitable, Callable, Dict, Optional, Sequence, Tuple
from typing import Any, Awaitable, Callable, Dict, List, Optional, Sequence, Tuple
from pipecat.frames.frames import (
EndFrame,
@@ -79,6 +79,7 @@ async def run_test(
expected_down_frames: Optional[Sequence[type]] = None,
expected_up_frames: Optional[Sequence[type]] = None,
ignore_start: bool = True,
observers: List[BaseObserver] = [],
start_metadata: Dict[str, Any] = {},
send_end_frame: bool = True,
) -> Tuple[Sequence[Frame], Sequence[Frame]]:
@@ -100,6 +101,7 @@ async def run_test(
task = PipelineTask(
pipeline,
params=PipelineParams(start_metadata=start_metadata),
observers=observers,
cancel_on_idle_timeout=False,
)