Fix warning about asyncio marker (#1078)

This commit is contained in:
Dmitry Anfimov 2022-12-31 02:48:53 +06:00 committed by GitHub
parent 491c2ca677
commit 64eb41db96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 1 additions and 24 deletions

View file

@ -20,6 +20,7 @@ def pytest_addoption(parser):
default=None, default=None,
help="run tests which require redis connection", help="run tests which require redis connection",
) )
parser.addini("asyncio_mode", "", default='auto')
def pytest_configure(config): def pytest_configure(config):

View file

@ -3,8 +3,6 @@ import pytest
from aiogram import Bot, types from aiogram import Bot, types
from . import BOT_ID, FakeTelegram from . import BOT_ID, FakeTelegram
pytestmark = pytest.mark.asyncio
async def test_get_me(bot: Bot): async def test_get_me(bot: Bot):
""" getMe method test """ """ getMe method test """

View file

@ -13,8 +13,6 @@ from aiogram.utils.json import json
from tests import TOKEN from tests import TOKEN
from tests.types.dataset import FILE from tests.types.dataset import FILE
pytestmark = pytest.mark.asyncio
@pytest_asyncio.fixture(name='bot') @pytest_asyncio.fixture(name='bot')
async def bot_fixture(): async def bot_fixture():

View file

@ -6,10 +6,7 @@ from redis.asyncio.connection import Connection, ConnectionPool
from aiogram.contrib.fsm_storage.memory import MemoryStorage from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.contrib.fsm_storage.redis import RedisStorage, RedisStorage2 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_asyncio.fixture()
@pytest.mark.redis @pytest.mark.redis

View file

@ -2,8 +2,6 @@ import pytest
from aiogram import Dispatcher, Bot from aiogram import Dispatcher, Bot
pytestmark = pytest.mark.asyncio
class TestDispatcherInit: class TestDispatcherInit:
async def test_successful_init(self, bot): async def test_successful_init(self, bot):

View file

@ -1,10 +1,7 @@
from unittest.mock import AsyncMock from unittest.mock import AsyncMock
import pytest
from aiogram.dispatcher.middlewares import LifetimeControllerMiddleware from aiogram.dispatcher.middlewares import LifetimeControllerMiddleware
pytestmark = pytest.mark.asyncio
async def test_no_skip(): async def test_no_skip():
class Middleware(LifetimeControllerMiddleware): class Middleware(LifetimeControllerMiddleware):

View file

@ -6,9 +6,6 @@ import pytest
from aiogram.dispatcher.filters import Text, CommandStart from aiogram.dispatcher.filters import Text, CommandStart
from aiogram.types import Message, CallbackQuery, InlineQuery, Poll from aiogram.types import Message, CallbackQuery, InlineQuery, Poll
# enable asyncio mode
pytestmark = pytest.mark.asyncio
def data_sample_1(): def data_sample_1():
return [ return [

View file

@ -4,8 +4,6 @@ import pytest_asyncio
from aiogram import Bot, types from aiogram import Bot, types
from . import FakeTelegram from . import FakeTelegram
pytestmark = pytest.mark.asyncio
@pytest_asyncio.fixture(name="message") @pytest_asyncio.fixture(name="message")
async def message_fixture(bot: Bot): async def message_fixture(bot: Bot):

View file

@ -8,8 +8,6 @@ from aiogram.utils.deep_linking import (
) )
from tests.types import dataset from tests.types import dataset
# enable asyncio mode
pytestmark = pytest.mark.asyncio
PAYLOADS = [ PAYLOADS = [
'foo', 'foo',

View file

@ -1,10 +1,7 @@
import pytest
from aiogram import Bot, types from aiogram import Bot, types
from .dataset import CHAT, FULL_CHAT from .dataset import CHAT, FULL_CHAT
from .. import FakeTelegram from .. import FakeTelegram
pytestmark = pytest.mark.asyncio
chat = types.Chat(**CHAT) chat = types.Chat(**CHAT)

View file

@ -14,8 +14,6 @@ from aiogram.utils.json import json
from tests import TOKEN from tests import TOKEN
from tests.types.dataset import FILE from tests.types.dataset import FILE
pytestmark = pytest.mark.asyncio
@pytest_asyncio.fixture(name='bot') @pytest_asyncio.fixture(name='bot')
async def bot_fixture(): async def bot_fixture():