mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Merge 66402e9cc0 into 0c6a705310
This commit is contained in:
commit
6c2569b661
6 changed files with 185 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue