From 613821af44c9bfd01a9d84c3cc9ebf2ea7d7ba2b Mon Sep 17 00:00:00 2001 From: Gabben <43146729+gabbhack@users.noreply.github.com> Date: Mon, 16 Mar 2020 23:29:51 +0500 Subject: [PATCH] Try to fix tests --- tests/test_api/test_client/test_base_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_api/test_client/test_base_bot.py b/tests/test_api/test_client/test_base_bot.py index a1036119..be5ce795 100644 --- a/tests/test_api/test_client/test_base_bot.py +++ b/tests/test_api/test_client/test_base_bot.py @@ -12,7 +12,7 @@ from aiogram.api.methods import GetMe try: from asynctest import CoroutineMock, patch except ImportError: - from unittest.mock import AsyncMock as CoroutineMock, MagicMock, patch # type: ignore + from unittest.mock import AsyncMock as CoroutineMock, patch # type: ignore class TestBaseBot: @@ -76,11 +76,11 @@ class TestBaseBot: ) # https://github.com/Tinche/aiofiles#writing-tests-for-aiofiles - aiofiles.threadpool.wrap.register(MagicMock)( + aiofiles.threadpool.wrap.register(CoroutineMock)( lambda *args, **kwargs: threadpool.AsyncBufferedIOBase(*args, **kwargs) ) - mock_file = MagicMock() + mock_file = CoroutineMock() base_bot = BaseBot("42:TEST") with patch("aiofiles.threadpool.sync_open", return_value=mock_file):