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,15 +1,10 @@
|
|||
from typing import Awaitable
|
||||
from unittest.mock import AsyncMock, patch
|
||||
|
||||
import pytest
|
||||
|
||||
from aiogram.filters import Filter
|
||||
|
||||
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
|
||||
|
||||
|
||||
|
|
@ -26,7 +21,7 @@ class TestBaseFilter:
|
|||
|
||||
with patch(
|
||||
"tests.test_filters.test_base.MyFilter.__call__",
|
||||
new_callable=CoroutineMock,
|
||||
new_callable=AsyncMock,
|
||||
) as mocked_call:
|
||||
call = my_filter(event="test")
|
||||
await call
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue