mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 18:19:34 +00:00
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:
parent
c7a85de579
commit
6db3778c6f
12 changed files with 36 additions and 88 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue