mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
Replaced error TypeError: TelegramEventObserver.__call__() got an unexpected keyword argument '<name>' with a more understandable (#1114)
* Explain why keyword filters is not supported * Added changelog
This commit is contained in:
parent
d07e8fc407
commit
021ae5626f
4 changed files with 30 additions and 4 deletions
|
|
@ -9,9 +9,11 @@ from aiogram.dispatcher.event.bases import REJECTED, SkipHandler
|
|||
from aiogram.dispatcher.event.handler import HandlerObject
|
||||
from aiogram.dispatcher.event.telegram import TelegramEventObserver
|
||||
from aiogram.dispatcher.router import Router
|
||||
from aiogram.exceptions import UnsupportedKeywordArgument
|
||||
from aiogram.filters import Filter
|
||||
from aiogram.types import Chat, Message, User
|
||||
|
||||
|
||||
# TODO: Test middlewares in routers tree
|
||||
|
||||
|
||||
|
|
@ -82,6 +84,11 @@ class TestTelegramEventObserver:
|
|||
assert f2 in callbacks
|
||||
assert MyFilter1(test="PASS") in callbacks
|
||||
|
||||
def test_keyword_filters_is_not_supported(self):
|
||||
router = Router()
|
||||
with pytest.raises(UnsupportedKeywordArgument):
|
||||
router.message.register(lambda e: True, commands=["test"])
|
||||
|
||||
def test_register_decorator(self):
|
||||
router = Router()
|
||||
observer = router.message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue