Remove asynctest dependency

This commit is contained in:
Alex Root Junior 2022-10-25 23:28:05 +03:00
parent 8370d57a24
commit ddf7b5f412
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
10 changed files with 34 additions and 87 deletions

View file

@ -3,6 +3,7 @@ import time
from asyncio import Event
from dataclasses import dataclass
from typing import Any, Dict
from unittest.mock import AsyncMock, patch
import pytest
from aiohttp import web
@ -21,12 +22,6 @@ from aiogram.webhook.aiohttp_server import (
from aiogram.webhook.security import IPFilter
from tests.mocked_bot import MockedBot
try:
from asynctest import CoroutineMock, patch
except ImportError:
from unittest.mock import AsyncMock as CoroutineMock # type: ignore
from unittest.mock import patch
class TestAiohttpServer:
def test_setup_application(self):
@ -110,7 +105,7 @@ class TestSimpleRequestHandler:
handler.handle_in_background = True
with patch(
"aiogram.dispatcher.dispatcher.Dispatcher.silent_call_request",
new_callable=CoroutineMock,
new_callable=AsyncMock,
) as mocked_silent_call_request:
handler_event.clear()
resp = await self.make_reqest(client=client)