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

@ -1,17 +1,12 @@
import functools
from typing import Any
from unittest.mock import AsyncMock, patch
import pytest
from aiogram.dispatcher.event.event import EventObserver
from aiogram.dispatcher.event.handler import HandlerObject
try:
from asynctest import CoroutineMock, patch
except ImportError:
from unittest.mock import AsyncMock as CoroutineMock # type: ignore
from unittest.mock import patch
pytestmark = pytest.mark.asyncio
@ -54,7 +49,7 @@ class TestEventObserver:
with patch(
"aiogram.dispatcher.event.handler.CallableMixin.call",
new_callable=CoroutineMock,
new_callable=AsyncMock,
) as mocked_my_handler:
results = await observer.trigger("test")
assert results is None