mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Fix pytest-asyncio deprecation warning in test (#1584)
Introduced in pytest-asyncio in: https://github.com/pytest-dev/pytest-asyncio/pull/648
This commit is contained in:
parent
718910f5b5
commit
080878be86
2 changed files with 4 additions and 2 deletions
1
CHANGES/1584.bugfix.rst
Normal file
1
CHANGES/1584.bugfix.rst
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Fix PytestDeprecationWarning thrown by pytest-asyncio when running the tests
|
||||||
|
|
@ -13,9 +13,10 @@ from tests.mocked_bot import MockedBot
|
||||||
|
|
||||||
|
|
||||||
class TestChatActionSender:
|
class TestChatActionSender:
|
||||||
async def test_wait(self, bot: Bot, event_loop: asyncio.BaseEventLoop):
|
async def test_wait(self, bot: Bot):
|
||||||
sender = ChatActionSender.typing(bot=bot, chat_id=42)
|
sender = ChatActionSender.typing(bot=bot, chat_id=42)
|
||||||
event_loop.call_soon(sender._close_event.set)
|
loop = asyncio.get_running_loop()
|
||||||
|
loop.call_soon(sender._close_event.set)
|
||||||
start = time.monotonic()
|
start = time.monotonic()
|
||||||
await sender._wait(1)
|
await sender._wait(1)
|
||||||
assert time.monotonic() - start < 1
|
assert time.monotonic() - start < 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue