diff --git a/tests/test_pgmq_backends.py b/tests/test_pgmq_backends.py index ad2732a5e..8169cafc3 100644 --- a/tests/test_pgmq_backends.py +++ b/tests/test_pgmq_backends.py @@ -23,14 +23,18 @@ import unittest from dataclasses import dataclass from pipecat.bus import BusDataMessage -from pipecat.bus.network.pgmq import PgmqBus -from pipecat.bus.network.pgmq_backends import ( - BackendMessage, - IsolatedPgmqBackend, - PgmqBackend, -) from pipecat.utils.asyncio.task_manager import TaskManager, TaskManagerParams +try: + from pipecat.bus.network.pgmq import PgmqBus + from pipecat.bus.network.pgmq_backends import ( + BackendMessage, + IsolatedPgmqBackend, + PgmqBackend, + ) +except Exception: + raise unittest.SkipTest("pgmq extra not installed (`pip install pipecat-ai[pgmq]`)") + # --------------------------------------------------------------------------- # IsolatedPgmqBackend: assert it speaks the right SQL to asyncpg. # --------------------------------------------------------------------------- diff --git a/tests/test_pgmq_bus.py b/tests/test_pgmq_bus.py index b8c09d46f..b93defe4d 100644 --- a/tests/test_pgmq_bus.py +++ b/tests/test_pgmq_bus.py @@ -19,13 +19,17 @@ from pipecat.bus import ( BusJobRequestMessage, BusSubscriber, ) -from pipecat.bus.network.pgmq import PgmqBus from pipecat.bus.serializers import JSONMessageSerializer from pipecat.frames.frames import TextFrame from pipecat.pipeline.base_task import BaseTask from pipecat.processors.frame_processor import FrameDirection from pipecat.utils.asyncio.task_manager import TaskManager, TaskManagerParams +try: + from pipecat.bus.network.pgmq import PgmqBus +except Exception: + raise unittest.SkipTest("pgmq extra not installed (`pip install pipecat-ai[pgmq]`)") + _sub_counter = itertools.count() diff --git a/tests/test_redis_bus.py b/tests/test_redis_bus.py index 0f1cc9511..21bace720 100644 --- a/tests/test_redis_bus.py +++ b/tests/test_redis_bus.py @@ -16,13 +16,17 @@ from pipecat.bus import ( BusJobRequestMessage, BusSubscriber, ) -from pipecat.bus.network.redis import RedisBus from pipecat.bus.serializers import JSONMessageSerializer from pipecat.frames.frames import TextFrame from pipecat.pipeline.base_task import BaseTask from pipecat.processors.frame_processor import FrameDirection from pipecat.utils.asyncio.task_manager import TaskManager, TaskManagerParams +try: + from pipecat.bus.network.redis import RedisBus +except Exception: + raise unittest.SkipTest("redis extra not installed (`pip install pipecat-ai[redis]`)") + _sub_counter = itertools.count()