From 8a18b1d28266e2655a84ed3237e49cd6313d25ca Mon Sep 17 00:00:00 2001 From: Oleg Matviichuk Date: Sun, 27 Jul 2025 16:38:57 +0200 Subject: [PATCH] Add sqlite to the test suite --- tests/conftest.py | 10 ++++++++++ tests/test_fsm/storage/test_storages.py | 1 + 2 files changed, 11 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index fe5c3d22..7c4ccead 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,6 +18,7 @@ from aiogram.fsm.storage.memory import ( ) from aiogram.fsm.storage.mongo import MongoStorage 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" @@ -111,6 +112,15 @@ async def memory_storage(): await storage.close() +@pytest.fixture() +async def squlite_storage(): + storage = SqliteStorage() + try: + yield storage + finally: + await storage.close() + + @pytest.fixture() async def redis_isolation(redis_storage): isolation = redis_storage.create_isolation() diff --git a/tests/test_fsm/storage/test_storages.py b/tests/test_fsm/storage/test_storages.py index 44424ed2..eb7bdf97 100644 --- a/tests/test_fsm/storage/test_storages.py +++ b/tests/test_fsm/storage/test_storages.py @@ -12,6 +12,7 @@ from aiogram.fsm.storage.base import BaseStorage, StorageKey pytest.lazy_fixture("redis_storage"), pytest.lazy_fixture("mongo_storage"), pytest.lazy_fixture("memory_storage"), + pytest.lazy_fixture("sqlite_storage"), ], ) class TestStorages: