mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
CR fix: fix function names, replace map to generator comprehension
This commit is contained in:
parent
2984c83099
commit
7df7273de4
2 changed files with 2 additions and 2 deletions
|
|
@ -69,7 +69,7 @@ class Command(Filter):
|
|||
if isinstance(commands, (str, BotCommand)):
|
||||
commands = (commands,)
|
||||
elif isinstance(commands, Iterable):
|
||||
if not all(map(lambda cmd: isinstance(cmd, (str, BotCommand)), commands)):
|
||||
if not all(isinstance(cmd, (str, BotCommand)) for cmd in commands):
|
||||
raise ValueError(
|
||||
"Command filter only supports str, BotCommand object or their Iterable"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ async def test_commands_filter_not_checked():
|
|||
assert not await start_filter.check(message_with_command)
|
||||
|
||||
|
||||
def test_commands_filter_not_checked():
|
||||
def test_commands_filter_raises_error():
|
||||
with pytest.raises(ValueError):
|
||||
start_filter = Command(commands=42) # noqa
|
||||
with pytest.raises(ValueError):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue