diff --git a/aiogram/dispatcher/fsm/storage/redis.py b/aiogram/dispatcher/fsm/storage/redis.py index c1fffc1b..8828691f 100644 --- a/aiogram/dispatcher/fsm/storage/redis.py +++ b/aiogram/dispatcher/fsm/storage/redis.py @@ -6,7 +6,7 @@ from aioredis import ConnectionPool, Redis from aiogram import Bot from aiogram.dispatcher.fsm.state import State -from aiogram.dispatcher.fsm.storage.base import BaseStorage, StateType, StorageKey, DEFAULT_DESTINY +from aiogram.dispatcher.fsm.storage.base import DEFAULT_DESTINY, BaseStorage, StateType, StorageKey DEFAULT_REDIS_LOCK_KWARGS = {"timeout": 60} diff --git a/tests/test_dispatcher/test_fsm/storage/test_redis.py b/tests/test_dispatcher/test_fsm/storage/test_redis.py index 786212f2..dcb71c3d 100644 --- a/tests/test_dispatcher/test_fsm/storage/test_redis.py +++ b/tests/test_dispatcher/test_fsm/storage/test_redis.py @@ -2,7 +2,7 @@ from typing import Literal import pytest -from aiogram.dispatcher.fsm.storage.base import StorageKey, DEFAULT_DESTINY +from aiogram.dispatcher.fsm.storage.base import DEFAULT_DESTINY, StorageKey from aiogram.dispatcher.fsm.storage.redis import DefaultKeyBuilder pytestmark = pytest.mark.asyncio @@ -11,7 +11,7 @@ PREFIX = "test" BOT_ID = 42 CHAT_ID = -1 USER_ID = 2 -FIELD: Literal["data"] = "data" +FIELD = "data" class TestRedisDefaultKeyBuilder: @@ -40,7 +40,8 @@ class TestRedisDefaultKeyBuilder: key = StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID) assert key_builder.build(key, FIELD) - key = StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID, - destiny="CUSTOM_TEST_DESTINY") + key = StorageKey( + chat_id=CHAT_ID, user_id=USER_ID, bot_id=BOT_ID, destiny="CUSTOM_TEST_DESTINY" + ) with pytest.raises(ValueError): key_builder.build(key, FIELD)