diff --git a/CHANGES/1584.bugfix.rst b/CHANGES/1584.bugfix.rst new file mode 100644 index 00000000..0e1c3a8c --- /dev/null +++ b/CHANGES/1584.bugfix.rst @@ -0,0 +1 @@ +Fix PytestDeprecationWarning thrown by pytest-asyncio when running the tests diff --git a/tests/test_utils/test_chat_action.py b/tests/test_utils/test_chat_action.py index b5c0a965..14048e00 100644 --- a/tests/test_utils/test_chat_action.py +++ b/tests/test_utils/test_chat_action.py @@ -13,9 +13,10 @@ from tests.mocked_bot import MockedBot 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) - event_loop.call_soon(sender._close_event.set) + loop = asyncio.get_running_loop() + loop.call_soon(sender._close_event.set) start = time.monotonic() await sender._wait(1) assert time.monotonic() - start < 1