aiogram/tests/test_handler/test_error.py
Alex Root Junior 730485e43a
Added full support of Bot API 6.4 (#1088)
* Remove warnings about pytest asyncio mode

* Update Bot API to 6.4

* Bump version

* Added changelog

* Update translations
2022-12-30 22:44:25 +02:00

17 lines
488 B
Python

from typing import Any
from aiogram.handlers import ErrorHandler
class TestErrorHandler:
async def test_extensions(self):
event = KeyError("kaboom")
class MyHandler(ErrorHandler):
async def handle(self) -> Any:
assert self.event == event
assert self.exception_name == event.__class__.__name__
assert self.exception_message == str(event)
return True
assert await MyHandler(event)