mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
Cover Dispatcher.run
This commit is contained in:
parent
90a035ed29
commit
acbe1f81b6
2 changed files with 7 additions and 4 deletions
|
|
@ -153,5 +153,6 @@ class Dispatcher(Router):
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return asyncio.run(self._run_polling(*bots, **kwargs))
|
return asyncio.run(self._run_polling(*bots, **kwargs))
|
||||||
except (KeyboardInterrupt, SystemExit): # Allow to graceful shutdown
|
except (KeyboardInterrupt, SystemExit): # pragma: no cover
|
||||||
|
# Allow to graceful shutdown
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
|
|
@ -189,6 +189,8 @@ class TestDispatcher:
|
||||||
mocked_process_update.assert_awaited()
|
mocked_process_update.assert_awaited()
|
||||||
mocked_emit_shutdown.assert_awaited()
|
mocked_emit_shutdown.assert_awaited()
|
||||||
|
|
||||||
@pytest.mark.skip
|
def test_run(self, bot: MockedBot):
|
||||||
def test_run(self):
|
dispatcher = Dispatcher()
|
||||||
pass
|
with patch("aiogram.dispatcher.dispatcher.Dispatcher._run_polling") as patched_run_polling:
|
||||||
|
dispatcher.run(bot)
|
||||||
|
patched_run_polling.assert_awaited_once()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue