From 47bdad40986867b8a7b03da638813d6072206070 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Wed, 18 Nov 2020 17:16:41 +0200 Subject: [PATCH] Reformat code --- aiogram/client/session/base.py | 2 +- aiogram/dispatcher/dispatcher.py | 2 +- aiogram/dispatcher/filters/command.py | 2 +- aiogram/dispatcher/filters/content_types.py | 3 ++- aiogram/dispatcher/filters/text.py | 2 +- aiogram/dispatcher/handler/callback_query.py | 2 +- aiogram/dispatcher/handler/chosen_inline_result.py | 2 +- aiogram/dispatcher/handler/inline_query.py | 2 +- aiogram/dispatcher/handler/message.py | 2 +- aiogram/dispatcher/handler/poll.py | 2 +- aiogram/dispatcher/handler/pre_checkout_query.py | 2 +- aiogram/dispatcher/handler/shipping_query.py | 2 +- aiogram/dispatcher/middlewares/user_context.py | 2 +- aiogram/dispatcher/router.py | 13 ------------- aiogram/types/chat_member.py | 1 + aiogram/types/message.py | 1 + aiogram/types/message_entity.py | 2 +- poetry.lock | 6 +++--- pyproject.toml | 2 +- .../test_session/test_aiohttp_session.py | 2 +- tests/test_dispatcher/test_event/test_handler.py | 2 +- tests/test_dispatcher/test_event/test_telegram.py | 2 +- tests/test_dispatcher/test_filters/test_command.py | 2 +- .../test_filters/test_content_types.py | 2 +- tests/test_dispatcher/test_filters/test_text.py | 2 +- tests/test_dispatcher/test_handler/test_base.py | 2 +- .../test_handler/test_callback_query.py | 2 +- .../test_handler/test_chosen_inline_result.py | 2 +- tests/test_dispatcher/test_handler/test_error.py | 2 +- .../test_handler/test_inline_query.py | 2 +- tests/test_dispatcher/test_handler/test_message.py | 2 +- tests/test_dispatcher/test_handler/test_poll.py | 2 +- .../test_handler/test_pre_checkout_query.py | 2 +- .../test_handler/test_shipping_query.py | 2 +- tests/test_dispatcher/test_router.py | 7 +++---- 35 files changed, 39 insertions(+), 50 deletions(-) diff --git a/aiogram/client/session/base.py b/aiogram/client/session/base.py index 8e1e8293..7a8edd4a 100644 --- a/aiogram/client/session/base.py +++ b/aiogram/client/session/base.py @@ -17,8 +17,8 @@ from typing import ( ) from aiogram.utils.exceptions import TelegramAPIError - from aiogram.utils.helper import Default + from ...methods import Response, TelegramMethod from ...types import UNSET from ..telegram import PRODUCTION, TelegramAPIServer diff --git a/aiogram/dispatcher/dispatcher.py b/aiogram/dispatcher/dispatcher.py index 8e99731f..a9b8aab7 100644 --- a/aiogram/dispatcher/dispatcher.py +++ b/aiogram/dispatcher/dispatcher.py @@ -9,7 +9,7 @@ from typing import Any, AsyncGenerator, Dict, Optional, Union from .. import loggers from ..client.bot import Bot from ..methods import TelegramMethod -from ..types import Update, User +from ..types import TelegramObject, Update, User from ..utils.exceptions import TelegramAPIError from .event.bases import UNHANDLED, SkipHandler from .event.telegram import TelegramEventObserver diff --git a/aiogram/dispatcher/filters/command.py b/aiogram/dispatcher/filters/command.py index 22327909..1d48c711 100644 --- a/aiogram/dispatcher/filters/command.py +++ b/aiogram/dispatcher/filters/command.py @@ -7,8 +7,8 @@ from typing import Any, Dict, Match, Optional, Pattern, Sequence, Union, cast from pydantic import validator from aiogram import Bot -from aiogram.types import Message from aiogram.dispatcher.filters import BaseFilter +from aiogram.types import Message CommandPatterType = Union[str, re.Pattern] diff --git a/aiogram/dispatcher/filters/content_types.py b/aiogram/dispatcher/filters/content_types.py index 8b6ed9d3..c8cc4392 100644 --- a/aiogram/dispatcher/filters/content_types.py +++ b/aiogram/dispatcher/filters/content_types.py @@ -2,8 +2,9 @@ from typing import Any, Dict, Optional, Sequence, Union from pydantic import validator -from ...types import Message from aiogram.types.message import ContentType + +from ...types import Message from .base import BaseFilter diff --git a/aiogram/dispatcher/filters/text.py b/aiogram/dispatcher/filters/text.py index d9692613..8141e07c 100644 --- a/aiogram/dispatcher/filters/text.py +++ b/aiogram/dispatcher/filters/text.py @@ -2,8 +2,8 @@ from typing import Any, Dict, Optional, Sequence, Union from pydantic import root_validator -from aiogram.types import CallbackQuery, InlineQuery, Message, Poll from aiogram.dispatcher.filters import BaseFilter +from aiogram.types import CallbackQuery, InlineQuery, Message, Poll TextType = str diff --git a/aiogram/dispatcher/handler/callback_query.py b/aiogram/dispatcher/handler/callback_query.py index 7bbf5354..8f129b21 100644 --- a/aiogram/dispatcher/handler/callback_query.py +++ b/aiogram/dispatcher/handler/callback_query.py @@ -1,8 +1,8 @@ from abc import ABC from typing import Optional -from aiogram.types import CallbackQuery, Message, User from aiogram.dispatcher.handler import BaseHandler +from aiogram.types import CallbackQuery, Message, User class CallbackQueryHandler(BaseHandler[CallbackQuery], ABC): diff --git a/aiogram/dispatcher/handler/chosen_inline_result.py b/aiogram/dispatcher/handler/chosen_inline_result.py index 820b2ced..58b75a32 100644 --- a/aiogram/dispatcher/handler/chosen_inline_result.py +++ b/aiogram/dispatcher/handler/chosen_inline_result.py @@ -1,7 +1,7 @@ from abc import ABC -from aiogram.types import ChosenInlineResult, User from aiogram.dispatcher.handler import BaseHandler +from aiogram.types import ChosenInlineResult, User class ChosenInlineResultHandler(BaseHandler[ChosenInlineResult], ABC): diff --git a/aiogram/dispatcher/handler/inline_query.py b/aiogram/dispatcher/handler/inline_query.py index 8858a664..13800523 100644 --- a/aiogram/dispatcher/handler/inline_query.py +++ b/aiogram/dispatcher/handler/inline_query.py @@ -1,7 +1,7 @@ from abc import ABC -from aiogram.types import InlineQuery, User from aiogram.dispatcher.handler import BaseHandler +from aiogram.types import InlineQuery, User class InlineQueryHandler(BaseHandler[InlineQuery], ABC): diff --git a/aiogram/dispatcher/handler/message.py b/aiogram/dispatcher/handler/message.py index 7d38fde0..91f39cff 100644 --- a/aiogram/dispatcher/handler/message.py +++ b/aiogram/dispatcher/handler/message.py @@ -1,9 +1,9 @@ from abc import ABC from typing import Optional, cast -from aiogram.types import Chat, Message, User from aiogram.dispatcher.filters import CommandObject from aiogram.dispatcher.handler.base import BaseHandler, BaseHandlerMixin +from aiogram.types import Chat, Message, User class MessageHandler(BaseHandler[Message], ABC): diff --git a/aiogram/dispatcher/handler/poll.py b/aiogram/dispatcher/handler/poll.py index 19a0ab55..de0e29a4 100644 --- a/aiogram/dispatcher/handler/poll.py +++ b/aiogram/dispatcher/handler/poll.py @@ -1,8 +1,8 @@ from abc import ABC from typing import List -from aiogram.types import Poll, PollOption from aiogram.dispatcher.handler import BaseHandler +from aiogram.types import Poll, PollOption class PollHandler(BaseHandler[Poll], ABC): diff --git a/aiogram/dispatcher/handler/pre_checkout_query.py b/aiogram/dispatcher/handler/pre_checkout_query.py index ab746626..92486257 100644 --- a/aiogram/dispatcher/handler/pre_checkout_query.py +++ b/aiogram/dispatcher/handler/pre_checkout_query.py @@ -1,7 +1,7 @@ from abc import ABC -from aiogram.types import PreCheckoutQuery, User from aiogram.dispatcher.handler import BaseHandler +from aiogram.types import PreCheckoutQuery, User class PreCheckoutQueryHandler(BaseHandler[PreCheckoutQuery], ABC): diff --git a/aiogram/dispatcher/handler/shipping_query.py b/aiogram/dispatcher/handler/shipping_query.py index ddce4f16..4abb9b9f 100644 --- a/aiogram/dispatcher/handler/shipping_query.py +++ b/aiogram/dispatcher/handler/shipping_query.py @@ -1,7 +1,7 @@ from abc import ABC -from aiogram.types import ShippingQuery, User from aiogram.dispatcher.handler import BaseHandler +from aiogram.types import ShippingQuery, User class ShippingQueryHandler(BaseHandler[ShippingQuery], ABC): diff --git a/aiogram/dispatcher/middlewares/user_context.py b/aiogram/dispatcher/middlewares/user_context.py index aa978bab..1434eec4 100644 --- a/aiogram/dispatcher/middlewares/user_context.py +++ b/aiogram/dispatcher/middlewares/user_context.py @@ -1,8 +1,8 @@ from contextlib import contextmanager from typing import Any, Awaitable, Callable, Dict, Iterator, Optional, Tuple -from aiogram.types import Chat, Update, User from aiogram.dispatcher.middlewares.base import BaseMiddleware +from aiogram.types import Chat, Update, User class UserContextMiddleware(BaseMiddleware[Update]): diff --git a/aiogram/dispatcher/router.py b/aiogram/dispatcher/router.py index eee7e638..3370d3c0 100644 --- a/aiogram/dispatcher/router.py +++ b/aiogram/dispatcher/router.py @@ -3,10 +3,8 @@ from __future__ import annotations import warnings from typing import Any, Dict, Generator, List, Optional, Union -from ..types import TelegramObject, Update from ..utils.imports import import_module from ..utils.warnings import CodeHasNoEffect -from .event.bases import UNHANDLED, SkipHandler from .event.event import EventObserver from .event.telegram import TelegramEventObserver from .filters import BUILTIN_FILTERS @@ -186,17 +184,6 @@ class Router: for router in self.sub_routers: await router.emit_shutdown(*args, **kwargs) - @property - def update_handler(self) -> TelegramEventObserver: - warnings.warn( - "`Router.update_handler(...)` is deprecated and will be removed in version 3.2 " - "use `Router.update(...)`", - DeprecationWarning, - stacklevel=2, - ) - - return self.update - @property def message_handler(self) -> TelegramEventObserver: warnings.warn( diff --git a/aiogram/types/chat_member.py b/aiogram/types/chat_member.py index 042de8b2..ded87878 100644 --- a/aiogram/types/chat_member.py +++ b/aiogram/types/chat_member.py @@ -4,6 +4,7 @@ import datetime from typing import TYPE_CHECKING, Optional, Union from aiogram.utils import helper + from .base import TelegramObject if TYPE_CHECKING: # pragma: no cover diff --git a/aiogram/types/message.py b/aiogram/types/message.py index 4d611456..a0d5bce8 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -6,6 +6,7 @@ from typing import TYPE_CHECKING, List, Optional, Union from pydantic import Field from aiogram.utils import helper + from .base import UNSET, TelegramObject if TYPE_CHECKING: # pragma: no cover diff --git a/aiogram/types/message_entity.py b/aiogram/types/message_entity.py index ae52d59c..fa56baf7 100644 --- a/aiogram/types/message_entity.py +++ b/aiogram/types/message_entity.py @@ -2,7 +2,7 @@ from __future__ import annotations from typing import TYPE_CHECKING, Optional -from .base import MutableTelegramObject, TelegramObject +from .base import MutableTelegramObject if TYPE_CHECKING: # pragma: no cover from .user import User diff --git a/poetry.lock b/poetry.lock index b1f5eadb..f36d31d0 100644 --- a/poetry.lock +++ b/poetry.lock @@ -337,7 +337,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] name = "importlib-metadata" -version = "1.7.0" +version = "2.0.0" description = "Read metadata from Python packages" category = "dev" optional = false @@ -1449,8 +1449,8 @@ imagesize = [ {file = "imagesize-1.2.0.tar.gz", hash = "sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1"}, ] importlib-metadata = [ - {file = "importlib_metadata-1.7.0-py2.py3-none-any.whl", hash = "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070"}, - {file = "importlib_metadata-1.7.0.tar.gz", hash = "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83"}, + {file = "importlib_metadata-2.0.0-py2.py3-none-any.whl", hash = "sha256:cefa1a2f919b866c5beb7c9f7b0ebb4061f30a8a9bf16d609b000e2dfaceb9c3"}, + {file = "importlib_metadata-2.0.0.tar.gz", hash = "sha256:77a540690e24b0305878c37ffd421785a6f7e53c8b5720d211b211de8d0e95da"}, ] ipython = [ {file = "ipython-7.19.0-py3-none-any.whl", hash = "sha256:c987e8178ced651532b3b1ff9965925bfd445c279239697052561a9ab806d28f"}, diff --git a/pyproject.toml b/pyproject.toml index b8c74f37..2d678495 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,7 +81,7 @@ proxy = ["aiohttp-socks"] [tool.black] line-length = 99 -target-version = ['py37', 'py38', 'py39'] +target-version = ['py37', 'py38'] exclude = ''' ( \.eggs diff --git a/tests/test_api/test_client/test_session/test_aiohttp_session.py b/tests/test_api/test_client/test_session/test_aiohttp_session.py index c5759244..5584348a 100644 --- a/tests/test_api/test_client/test_session/test_aiohttp_session.py +++ b/tests/test_api/test_client/test_session/test_aiohttp_session.py @@ -1,11 +1,11 @@ from typing import AsyncContextManager, AsyncGenerator -from aiogram.client.session import aiohttp import aiohttp_socks import pytest from aresponses import ResponsesMockServer from aiogram import Bot +from aiogram.client.session import aiohttp from aiogram.client.session.aiohttp import AiohttpSession from aiogram.methods import Request, TelegramMethod from aiogram.types import InputFile diff --git a/tests/test_dispatcher/test_event/test_handler.py b/tests/test_dispatcher/test_event/test_handler.py index 0b842ecf..f67b848e 100644 --- a/tests/test_dispatcher/test_event/test_handler.py +++ b/tests/test_dispatcher/test_event/test_handler.py @@ -3,11 +3,11 @@ from typing import Any, Dict, Union import pytest -from aiogram.types import Update from aiogram.dispatcher.event.handler import CallableMixin, FilterObject, HandlerObject from aiogram.dispatcher.filters import Text from aiogram.dispatcher.filters.base import BaseFilter from aiogram.dispatcher.handler.base import BaseHandler +from aiogram.types import Update def callback1(foo: int, bar: int, baz: int): diff --git a/tests/test_dispatcher/test_event/test_telegram.py b/tests/test_dispatcher/test_event/test_telegram.py index a02e2485..d4306b1a 100644 --- a/tests/test_dispatcher/test_event/test_telegram.py +++ b/tests/test_dispatcher/test_event/test_telegram.py @@ -4,12 +4,12 @@ from typing import Any, Awaitable, Callable, Dict, NoReturn, Union import pytest -from aiogram.types import Chat, Message, User from aiogram.dispatcher.event.bases import SkipHandler from aiogram.dispatcher.event.handler import HandlerObject from aiogram.dispatcher.event.telegram import TelegramEventObserver from aiogram.dispatcher.filters.base import BaseFilter from aiogram.dispatcher.router import Router +from aiogram.types import Chat, Message, User # TODO: Test middlewares in routers tree diff --git a/tests/test_dispatcher/test_filters/test_command.py b/tests/test_dispatcher/test_filters/test_command.py index b19f0042..6eb24097 100644 --- a/tests/test_dispatcher/test_filters/test_command.py +++ b/tests/test_dispatcher/test_filters/test_command.py @@ -4,9 +4,9 @@ from typing import Match import pytest +from aiogram.dispatcher.filters import Command, CommandObject from aiogram.methods import GetMe from aiogram.types import Chat, Message, User -from aiogram.dispatcher.filters import Command, CommandObject from tests.mocked_bot import MockedBot diff --git a/tests/test_dispatcher/test_filters/test_content_types.py b/tests/test_dispatcher/test_filters/test_content_types.py index 60dbee08..a009acfa 100644 --- a/tests/test_dispatcher/test_filters/test_content_types.py +++ b/tests/test_dispatcher/test_filters/test_content_types.py @@ -4,8 +4,8 @@ from typing import cast import pytest from pydantic import ValidationError -from aiogram.types import ContentType, Message from aiogram.dispatcher.filters import ContentTypesFilter +from aiogram.types import ContentType, Message @dataclass diff --git a/tests/test_dispatcher/test_filters/test_text.py b/tests/test_dispatcher/test_filters/test_text.py index ed91bbb6..72f95e9d 100644 --- a/tests/test_dispatcher/test_filters/test_text.py +++ b/tests/test_dispatcher/test_filters/test_text.py @@ -5,9 +5,9 @@ from typing import Sequence, Type import pytest from pydantic import ValidationError -from aiogram.types import CallbackQuery, Chat, InlineQuery, Message, Poll, PollOption, User from aiogram.dispatcher.filters import BUILTIN_FILTERS from aiogram.dispatcher.filters.text import Text +from aiogram.types import CallbackQuery, Chat, InlineQuery, Message, Poll, PollOption, User class TestText: diff --git a/tests/test_dispatcher/test_handler/test_base.py b/tests/test_dispatcher/test_handler/test_base.py index bb0bc296..88982907 100644 --- a/tests/test_dispatcher/test_handler/test_base.py +++ b/tests/test_dispatcher/test_handler/test_base.py @@ -6,9 +6,9 @@ from typing import Any import pytest from aiogram import Bot -from aiogram.types import Chat, Message, Update from aiogram.dispatcher.event.handler import HandlerObject from aiogram.dispatcher.handler.base import BaseHandler +from aiogram.types import Chat, Message, Update class MyHandler(BaseHandler): diff --git a/tests/test_dispatcher/test_handler/test_callback_query.py b/tests/test_dispatcher/test_handler/test_callback_query.py index 69c51e71..e47534f4 100644 --- a/tests/test_dispatcher/test_handler/test_callback_query.py +++ b/tests/test_dispatcher/test_handler/test_callback_query.py @@ -2,8 +2,8 @@ from typing import Any import pytest -from aiogram.types import CallbackQuery, User from aiogram.dispatcher.handler import CallbackQueryHandler +from aiogram.types import CallbackQuery, User class TestCallbackQueryHandler: diff --git a/tests/test_dispatcher/test_handler/test_chosen_inline_result.py b/tests/test_dispatcher/test_handler/test_chosen_inline_result.py index ebf8359a..2e1f4045 100644 --- a/tests/test_dispatcher/test_handler/test_chosen_inline_result.py +++ b/tests/test_dispatcher/test_handler/test_chosen_inline_result.py @@ -2,8 +2,8 @@ from typing import Any import pytest -from aiogram.types import CallbackQuery, ChosenInlineResult, User from aiogram.dispatcher.handler import ChosenInlineResultHandler +from aiogram.types import CallbackQuery, ChosenInlineResult, User class TestChosenInlineResultHandler: diff --git a/tests/test_dispatcher/test_handler/test_error.py b/tests/test_dispatcher/test_handler/test_error.py index d1ba0eb7..f6e6b090 100644 --- a/tests/test_dispatcher/test_handler/test_error.py +++ b/tests/test_dispatcher/test_handler/test_error.py @@ -2,6 +2,7 @@ from typing import Any import pytest +from aiogram.dispatcher.handler import ErrorHandler, PollHandler from aiogram.types import ( CallbackQuery, InlineQuery, @@ -11,7 +12,6 @@ from aiogram.types import ( ShippingQuery, User, ) -from aiogram.dispatcher.handler import ErrorHandler, PollHandler class TestErrorHandler: diff --git a/tests/test_dispatcher/test_handler/test_inline_query.py b/tests/test_dispatcher/test_handler/test_inline_query.py index fad9a230..100fccdd 100644 --- a/tests/test_dispatcher/test_handler/test_inline_query.py +++ b/tests/test_dispatcher/test_handler/test_inline_query.py @@ -2,8 +2,8 @@ from typing import Any import pytest -from aiogram.types import CallbackQuery, InlineQuery, User from aiogram.dispatcher.handler import InlineQueryHandler +from aiogram.types import CallbackQuery, InlineQuery, User class TestCallbackQueryHandler: diff --git a/tests/test_dispatcher/test_handler/test_message.py b/tests/test_dispatcher/test_handler/test_message.py index 6ce6f5f1..5f95d2bd 100644 --- a/tests/test_dispatcher/test_handler/test_message.py +++ b/tests/test_dispatcher/test_handler/test_message.py @@ -3,9 +3,9 @@ from typing import Any import pytest -from aiogram.types import Chat, Message, User from aiogram.dispatcher.filters import CommandObject from aiogram.dispatcher.handler.message import MessageHandler, MessageHandlerCommandMixin +from aiogram.types import Chat, Message, User class MyHandler(MessageHandler): diff --git a/tests/test_dispatcher/test_handler/test_poll.py b/tests/test_dispatcher/test_handler/test_poll.py index 36438332..172012d6 100644 --- a/tests/test_dispatcher/test_handler/test_poll.py +++ b/tests/test_dispatcher/test_handler/test_poll.py @@ -2,6 +2,7 @@ from typing import Any import pytest +from aiogram.dispatcher.handler import PollHandler from aiogram.types import ( CallbackQuery, InlineQuery, @@ -11,7 +12,6 @@ from aiogram.types import ( ShippingQuery, User, ) -from aiogram.dispatcher.handler import PollHandler class TestShippingQueryHandler: diff --git a/tests/test_dispatcher/test_handler/test_pre_checkout_query.py b/tests/test_dispatcher/test_handler/test_pre_checkout_query.py index 89cbb0fa..828bd57d 100644 --- a/tests/test_dispatcher/test_handler/test_pre_checkout_query.py +++ b/tests/test_dispatcher/test_handler/test_pre_checkout_query.py @@ -2,8 +2,8 @@ from typing import Any import pytest -from aiogram.types import PreCheckoutQuery, User from aiogram.dispatcher.handler import PreCheckoutQueryHandler +from aiogram.types import PreCheckoutQuery, User class TestPreCheckoutQueryHandler: diff --git a/tests/test_dispatcher/test_handler/test_shipping_query.py b/tests/test_dispatcher/test_handler/test_shipping_query.py index 5643b618..0d5aa578 100644 --- a/tests/test_dispatcher/test_handler/test_shipping_query.py +++ b/tests/test_dispatcher/test_handler/test_shipping_query.py @@ -2,8 +2,8 @@ from typing import Any import pytest -from aiogram.types import CallbackQuery, InlineQuery, ShippingAddress, ShippingQuery, User from aiogram.dispatcher.handler import ShippingQueryHandler +from aiogram.types import CallbackQuery, InlineQuery, ShippingAddress, ShippingQuery, User class TestShippingQueryHandler: diff --git a/tests/test_dispatcher/test_router.py b/tests/test_dispatcher/test_router.py index d3e4d4c3..093715b1 100644 --- a/tests/test_dispatcher/test_router.py +++ b/tests/test_dispatcher/test_router.py @@ -3,6 +3,9 @@ from typing import Any import pytest +from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler, skip +from aiogram.dispatcher.middlewares.user_context import UserContextMiddleware +from aiogram.dispatcher.router import Router from aiogram.types import ( CallbackQuery, Chat, @@ -18,9 +21,6 @@ from aiogram.types import ( Update, User, ) -from aiogram.dispatcher.event.bases import UNHANDLED, SkipHandler, skip -from aiogram.dispatcher.middlewares.user_context import UserContextMiddleware -from aiogram.dispatcher.router import Router from aiogram.utils.warnings import CodeHasNoEffect importable_router = Router() @@ -92,7 +92,6 @@ class TestRouter: assert router.observers["pre_checkout_query"] == router.pre_checkout_query assert router.observers["poll"] == router.poll - @pytest.mark.asyncio async def test_emit_startup(self): router1 = Router()