mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Py3.14 support
Bump .pre-commit-config.yaml Bump `mongo` feature deps Bump `proxy` feature dep Bump `test` feature deps Bump `dev` feature deps Set `aiohttp` max version `<3.14` Fix `test_isolation.py` tests Fix `test_storages.py` tests Add Py version limit `<3.15` (breaking changes possible) Add new `uvloop` starter to `Dispatcher.run_polling` Remove old `uvloop` `set_event_loop_policy` Remove `pytest-lazy-fixture`
This commit is contained in:
parent
0c6a705310
commit
7c6d78cf30
7 changed files with 58 additions and 51 deletions
|
|
@ -39,7 +39,7 @@ def pytest_configure(config):
|
|||
config.addinivalue_line("markers", "redis: marked tests require redis connection to run")
|
||||
config.addinivalue_line("markers", "mongo: marked tests require mongo connection to run")
|
||||
|
||||
if sys.platform == "win32":
|
||||
if sys.platform == "win32" and sys.version_info < (3, 14):
|
||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
||||
else:
|
||||
asyncio.set_event_loop_policy(asyncio.DefaultEventLoopPolicy())
|
||||
|
|
@ -186,6 +186,16 @@ async def dispatcher():
|
|||
await dp.emit_shutdown()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def storage(request):
|
||||
return request.getfixturevalue(request.param)
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def isolation(request):
|
||||
return request.getfixturevalue(request.param)
|
||||
|
||||
|
||||
# @pytest.fixture(scope="session")
|
||||
# def event_loop_policy(request):
|
||||
# if sys.platform == "win32":
|
||||
|
|
|
|||
|
|
@ -8,11 +8,8 @@ from aiogram.fsm.storage.redis import RedisEventIsolation, RedisStorage
|
|||
|
||||
@pytest.mark.parametrize(
|
||||
"isolation",
|
||||
[
|
||||
pytest.lazy_fixture("redis_isolation"),
|
||||
pytest.lazy_fixture("lock_isolation"),
|
||||
pytest.lazy_fixture("disabled_isolation"),
|
||||
],
|
||||
["redis_isolation", "lock_isolation", "disabled_isolation"],
|
||||
indirect=True,
|
||||
)
|
||||
class TestIsolations:
|
||||
async def test_lock(
|
||||
|
|
|
|||
|
|
@ -8,12 +8,8 @@ from aiogram.fsm.storage.base import BaseStorage, StorageKey
|
|||
|
||||
@pytest.mark.parametrize(
|
||||
"storage",
|
||||
[
|
||||
pytest.lazy_fixture("redis_storage"),
|
||||
pytest.lazy_fixture("mongo_storage"),
|
||||
pytest.lazy_fixture("pymongo_storage"),
|
||||
pytest.lazy_fixture("memory_storage"),
|
||||
],
|
||||
["memory_storage", "redis_storage", "mongo_storage", "pymongo_storage"],
|
||||
indirect=True,
|
||||
)
|
||||
class TestStorages:
|
||||
async def test_set_state(self, storage: BaseStorage, storage_key: StorageKey):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue