This commit is contained in:
Oleg Matviichuk 2025-10-08 12:51:55 +03:00 committed by GitHub
commit 6c2569b661
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 185 additions and 0 deletions

View file

@ -19,6 +19,7 @@ from aiogram.fsm.storage.memory import (
from aiogram.fsm.storage.mongo import MongoStorage
from aiogram.fsm.storage.pymongo import PyMongoStorage
from aiogram.fsm.storage.redis import RedisStorage
from aiogram.fsm.storage.sqlite import SqliteStorage
from tests.mocked_bot import MockedBot
DATA_DIR = Path(__file__).parent / "data"
@ -142,6 +143,16 @@ async def memory_storage():
await storage.close()
@pytest.fixture()
async def sqlite_storage():
storage = await SqliteStorage.connect("aiogram_fsm_test.sqlite")
try:
yield storage
finally:
await storage.close()
Path("aiogram_fsm_test.sqlite").unlink()
@pytest.fixture()
async def redis_isolation(redis_storage):
isolation = redis_storage.create_isolation()

View file

@ -13,6 +13,7 @@ from aiogram.fsm.storage.base import BaseStorage, StorageKey
pytest.lazy_fixture("mongo_storage"),
pytest.lazy_fixture("pymongo_storage"),
pytest.lazy_fixture("memory_storage"),
pytest.lazy_fixture("sqlite_storage"),
],
)
class TestStorages: