diff --git a/pyproject.toml b/pyproject.toml index be0bdfb3..511d89b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,29 +62,29 @@ redis = [ "redis[hiredis]~=5.0.1", ] mongo = [ - "motor~=3.5.1", + "motor~=3.3.2", ] proxy = [ - "aiohttp-socks~=0.9.0", + "aiohttp-socks~=0.8.3", ] i18n = [ "Babel~=2.13.0", ] cli = [ - "aiogram-cli~=1.1.0", + "aiogram-cli~=1.0.3", ] test = [ - "pytest~=8.3.2", - "pytest-html~=4.1.1", - "pytest-asyncio~=0.23.8", - "pytest-lazy-fixtures~=1.1.1", - "pytest-mock~=3.14.0", + "pytest~=7.4.2", + "pytest-html~=4.0.2", + "pytest-asyncio~=0.21.1", + "pytest-lazy-fixture~=0.6.3", + "pytest-mock~=3.12.0", "pytest-mypy~=0.10.3", - "pytest-cov~=5.0.0", + "pytest-cov~=4.1.0", "pytest-aiohttp~=1.0.5", - "aresponses~=3.0.0", - "pytz~=2024.1", - "pycryptodomex~=3.20.0", + "aresponses~=2.1.6", + "pytz~=2023.3", + "pycryptodomex~=3.19.0", ] docs = [ "Sphinx~=7.2.6", @@ -101,10 +101,10 @@ docs = [ "sphinxcontrib-towncrier~=0.3.2a0", ] dev = [ - "black~=24.8.0", + "black~=24.4.2", "isort~=5.13.2", "ruff~=0.5.1", - "mypy~=1.11.1", + "mypy~=1.10.0", "toml~=0.10.2", "pre-commit~=3.5", "packaging~=24.1", diff --git a/tests/conftest.py b/tests/conftest.py index fe5c3d22..a61a52b9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -40,8 +40,7 @@ def pytest_configure(config): if sys.platform == "win32": asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) - else: - asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy()) + return asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy()) @pytest.fixture() @@ -54,6 +53,7 @@ def redis_server(request): @pytest.fixture() +@pytest.mark.redis async def redis_storage(redis_server): try: parse_redis_url(redis_server) @@ -82,6 +82,7 @@ def mongo_server(request): @pytest.fixture() +@pytest.mark.mongo async def mongo_storage(mongo_server): try: parse_mongo_url(mongo_server) @@ -112,6 +113,7 @@ async def memory_storage(): @pytest.fixture() +@pytest.mark.redis async def redis_isolation(redis_storage): isolation = redis_storage.create_isolation() return isolation diff --git a/tests/test_fsm/storage/test_isolation.py b/tests/test_fsm/storage/test_isolation.py index 80e8b014..867362c1 100644 --- a/tests/test_fsm/storage/test_isolation.py +++ b/tests/test_fsm/storage/test_isolation.py @@ -1,7 +1,7 @@ +from unittest import mock from unittest.mock import AsyncMock, patch import pytest -from pytest_lazy_fixtures import lf from aiogram.fsm.storage.base import BaseEventIsolation, StorageKey from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage @@ -10,9 +10,9 @@ from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage @pytest.mark.parametrize( "isolation", [ - lf("redis_isolation"), - lf("lock_isolation"), - lf("disabled_isolation"), + pytest.lazy_fixture("redis_isolation"), + pytest.lazy_fixture("lock_isolation"), + pytest.lazy_fixture("disabled_isolation"), ], ) class TestIsolations: diff --git a/tests/test_fsm/storage/test_storages.py b/tests/test_fsm/storage/test_storages.py index f686c617..690bc791 100644 --- a/tests/test_fsm/storage/test_storages.py +++ b/tests/test_fsm/storage/test_storages.py @@ -1,5 +1,4 @@ import pytest -from pytest_lazy_fixtures import lf from aiogram.fsm.storage.base import BaseStorage, StorageKey @@ -7,9 +6,9 @@ from aiogram.fsm.storage.base import BaseStorage, StorageKey @pytest.mark.parametrize( "storage", [ - lf("redis_storage"), - lf("mongo_storage"), - lf("memory_storage"), + pytest.lazy_fixture("redis_storage"), + pytest.lazy_fixture("mongo_storage"), + pytest.lazy_fixture("memory_storage"), ], ) class TestStorages: