Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warning about asyncio marker in tests #1078

Merged
merged 1 commit into from Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/conftest.py
Expand Up @@ -20,6 +20,7 @@ def pytest_addoption(parser):
default=None,
help="run tests which require redis connection",
)
parser.addini("asyncio_mode", "", default='auto')


def pytest_configure(config):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_bot.py
Expand Up @@ -3,8 +3,6 @@
from aiogram import Bot, types
from . import BOT_ID, FakeTelegram

pytestmark = pytest.mark.asyncio


async def test_get_me(bot: Bot):
""" getMe method test """
Expand Down
2 changes: 0 additions & 2 deletions tests/test_bot/test_bot_download_file.py
Expand Up @@ -13,8 +13,6 @@
from tests import TOKEN
from tests.types.dataset import FILE

pytestmark = pytest.mark.asyncio


@pytest_asyncio.fixture(name='bot')
async def bot_fixture():
Expand Down
3 changes: 0 additions & 3 deletions tests/test_contrib/test_fsm_storage/test_storage.py
Expand Up @@ -6,10 +6,7 @@

from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.contrib.fsm_storage.redis import RedisStorage, RedisStorage2
from aiogram.types import Chat, User
from tests.types.dataset import CHAT, USER

pytestmark = pytest.mark.asyncio

@pytest_asyncio.fixture()
@pytest.mark.redis
Expand Down
2 changes: 0 additions & 2 deletions tests/test_dispatcher.py
Expand Up @@ -2,8 +2,6 @@

from aiogram import Dispatcher, Bot

pytestmark = pytest.mark.asyncio


class TestDispatcherInit:
async def test_successful_init(self, bot):
Expand Down
@@ -1,10 +1,7 @@
from unittest.mock import AsyncMock

import pytest
from aiogram.dispatcher.middlewares import LifetimeControllerMiddleware

pytestmark = pytest.mark.asyncio


async def test_no_skip():
class Middleware(LifetimeControllerMiddleware):
Expand Down
3 changes: 0 additions & 3 deletions tests/test_filters.py
Expand Up @@ -6,9 +6,6 @@
from aiogram.dispatcher.filters import Text, CommandStart
from aiogram.types import Message, CallbackQuery, InlineQuery, Poll

# enable asyncio mode
pytestmark = pytest.mark.asyncio


def data_sample_1():
return [
Expand Down
2 changes: 0 additions & 2 deletions tests/test_message.py
Expand Up @@ -4,8 +4,6 @@
from aiogram import Bot, types
from . import FakeTelegram

pytestmark = pytest.mark.asyncio


@pytest_asyncio.fixture(name="message")
async def message_fixture(bot: Bot):
Expand Down
2 changes: 0 additions & 2 deletions tests/test_utils/test_deep_linking.py
Expand Up @@ -8,8 +8,6 @@
)
from tests.types import dataset

# enable asyncio mode
pytestmark = pytest.mark.asyncio

PAYLOADS = [
'foo',
Expand Down
3 changes: 0 additions & 3 deletions tests/types/test_chat.py
@@ -1,10 +1,7 @@
import pytest

from aiogram import Bot, types
from .dataset import CHAT, FULL_CHAT
from .. import FakeTelegram

pytestmark = pytest.mark.asyncio

chat = types.Chat(**CHAT)

Expand Down
2 changes: 0 additions & 2 deletions tests/types/test_mixins.py
Expand Up @@ -14,8 +14,6 @@
from tests import TOKEN
from tests.types.dataset import FILE

pytestmark = pytest.mark.asyncio


@pytest_asyncio.fixture(name='bot')
async def bot_fixture():
Expand Down