Revert "Just try to set custom event loop policy manually"

This reverts commit 04ee60d878.
This commit is contained in:
JRoot Junior 2024-08-07 01:04:23 +03:00
parent 04ee60d878
commit dc412543ed
No known key found for this signature in database
GPG key ID: 738964250D5FF6E2
4 changed files with 25 additions and 24 deletions

View file

@ -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

View file

@ -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:

View file

@ -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: