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
11 changes: 8 additions & 3 deletions tests/unit/storages/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
)

if TYPE_CHECKING:
from collections.abc import AsyncGenerator

from fakeredis import FakeAsyncRedis


@pytest.fixture(params=['memory', 'file_system', 'sql', 'redis'])
def storage_client(
async def storage_client(
request: pytest.FixtureRequest,
redis_client: FakeAsyncRedis,
) -> StorageClient:
) -> AsyncGenerator[StorageClient, None]:
"""Parameterized fixture to test with different storage clients."""
storage_client: StorageClient

Expand All @@ -36,4 +38,7 @@ def storage_client(
else:
storage_client = FileSystemStorageClient()
service_locator.set_storage_client(storage_client)
return storage_client
yield storage_client

if isinstance(storage_client, SqlStorageClient):
await storage_client.close()
Loading