From 26daadd589a8e7404fb2f28d720785c5363e9424 Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Tue, 25 Oct 2022 23:35:31 +0300 Subject: [PATCH] Fixed aiofiles tests --- tests/test_api/test_client/test_bot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_api/test_client/test_bot.py b/tests/test_api/test_client/test_bot.py index 742d1c2a..7266bdcd 100644 --- a/tests/test_api/test_client/test_bot.py +++ b/tests/test_api/test_client/test_bot.py @@ -1,7 +1,7 @@ import io import os from tempfile import mkstemp -from unittest.mock import AsyncMock, patch +from unittest.mock import AsyncMock, MagicMock, patch import aiofiles import pytest @@ -73,11 +73,11 @@ class TestBot: ) # https://github.com/Tinche/aiofiles#writing-tests-for-aiofiles - aiofiles.threadpool.wrap.register(AsyncMock)( + aiofiles.threadpool.wrap.register(MagicMock)( lambda *args, **kwargs: aiofiles.threadpool.binary.AsyncBufferedIOBase(*args, **kwargs) ) - mock_file = AsyncMock() + mock_file = MagicMock() bot = Bot("42:TEST") with patch("aiofiles.threadpool.sync_open", return_value=mock_file):