Define create_storage_key fixture in conftest.py

This commit is contained in:
Rishat Fayzullin 2024-06-13 14:02:44 +03:00
parent bbba6ce840
commit 369efee342
4 changed files with 10 additions and 20 deletions

View file

@ -5,12 +5,6 @@ import pytest
from aiogram.fsm.storage.base import BaseEventIsolation, StorageKey
from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage
from tests.mocked_bot import MockedBot
@pytest.fixture(name="storage_key")
def create_storage_key(bot: MockedBot):
return StorageKey(chat_id=-42, user_id=42, bot_id=bot.id)
@pytest.mark.parametrize(

View file

@ -2,16 +2,9 @@ import pytest
from aiogram.fsm.state import State
from aiogram.fsm.storage.mongo import MongoStorage, StorageKey
from tests.mocked_bot import MockedBot
from tests.conftest import CHAT_ID, USER_ID
PREFIX = "fsm"
CHAT_ID = -42
USER_ID = 42
@pytest.fixture(name="storage_key")
def create_storage_key(bot: MockedBot):
return StorageKey(chat_id=CHAT_ID, user_id=USER_ID, bot_id=bot.id)
async def test_update_not_existing_data_with_empty_dictionary(

View file

@ -1,12 +1,6 @@
import pytest
from aiogram.fsm.storage.base import BaseStorage, StorageKey
from tests.mocked_bot import MockedBot
@pytest.fixture(name="storage_key")
def create_storage_key(bot: MockedBot):
return StorageKey(chat_id=-42, user_id=42, bot_id=bot.id)
@pytest.mark.parametrize(