mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
refactor: remove redundant pytest marks (#654)
This commit is contained in:
parent
fff33e4ac9
commit
f2f276b8cf
111 changed files with 221 additions and 256 deletions
|
|
@ -3,6 +3,8 @@ import pytest
|
|||
from aiogram.dispatcher.fsm.storage.redis import RedisStorage
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.mark.redis
|
||||
class TestRedisStorage:
|
||||
|
|
@ -15,7 +17,6 @@ class TestRedisStorage:
|
|||
[lambda bot: "kaboom", "fsm:kaboom:-1:2"],
|
||||
],
|
||||
)
|
||||
@pytest.mark.asyncio
|
||||
async def test_generate_key(self, bot: MockedBot, redis_server, prefix_bot, result):
|
||||
storage = RedisStorage.from_url(redis_server, prefix_bot=prefix_bot)
|
||||
assert storage.generate_key(bot, -1, 2) == result
|
||||
|
|
|
|||
|
|
@ -3,19 +3,19 @@ import pytest
|
|||
from aiogram.dispatcher.fsm.storage.base import BaseStorage
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"storage",
|
||||
[pytest.lazy_fixture("redis_storage"), pytest.lazy_fixture("memory_storage")],
|
||||
)
|
||||
class TestStorages:
|
||||
@pytest.mark.asyncio
|
||||
async def test_lock(self, bot: MockedBot, storage: BaseStorage):
|
||||
# TODO: ?!?
|
||||
async with storage.lock(bot=bot, chat_id=-42, user_id=42):
|
||||
assert True, "You are kidding me?"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_state(self, bot: MockedBot, storage: BaseStorage):
|
||||
assert await storage.get_state(bot=bot, chat_id=-42, user_id=42) is None
|
||||
|
||||
|
|
@ -24,7 +24,6 @@ class TestStorages:
|
|||
await storage.set_state(bot=bot, chat_id=-42, user_id=42, state=None)
|
||||
assert await storage.get_state(bot=bot, chat_id=-42, user_id=42) is None
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_set_data(self, bot: MockedBot, storage: BaseStorage):
|
||||
assert await storage.get_data(bot=bot, chat_id=-42, user_id=42) == {}
|
||||
|
||||
|
|
@ -33,7 +32,6 @@ class TestStorages:
|
|||
await storage.set_data(bot=bot, chat_id=-42, user_id=42, data={})
|
||||
assert await storage.get_data(bot=bot, chat_id=-42, user_id=42) == {}
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_update_data(self, bot: MockedBot, storage: BaseStorage):
|
||||
assert await storage.get_data(bot=bot, chat_id=-42, user_id=42) == {}
|
||||
assert await storage.update_data(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue