Tests on Python 3.11 (#1044)

* Try to use Python 3.11

* Remove `asynctest` dependency

* Fixed aiofiles tests

* Added changelog
This commit is contained in:
Alex Root Junior 2022-10-26 22:21:04 +03:00 committed by GitHub
parent c7a85de579
commit 6db3778c6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 36 additions and 88 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)