diff --git a/pyproject.toml b/pyproject.toml index f13cdf7..7a15444 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ Documentation = "https://async-wrapper.readthedocs.io/" Repository = "https://github.com/phi-friday/async-wrapper" [project.optional-dependencies] -uvloop = ["uvloop; platform_system != 'Windows'"] +uvloop = ["uvloop; platform_system != 'Windows' and python_version != '3.13'"] sqlalchemy = ["sqlalchemy[asyncio]", "greenlet"] test = [ "pytest>=8.0.0", diff --git a/src/tests/conftest.py b/src/tests/conftest.py index deb0502..9dab687 100644 --- a/src/tests/conftest.py +++ b/src/tests/conftest.py @@ -1,19 +1,24 @@ from __future__ import annotations +import sys from typing import Any import pytest +anyio_params = [ + pytest.param(("asyncio", {"use_uvloop": False}), id="asyncio"), + pytest.param( + ("trio", {"restrict_keyboard_interrupt_to_checkpoints": True}), id="trio" + ), +] +if sys.version_info < (3, 13): + # FIXME: uvloop build error + # see more: https://github.com/MagicStack/uvloop/issues/622 + anyio_params.append( + pytest.param(("asyncio", {"use_uvloop": True}), id="asyncio-uvloop") + ) -@pytest.fixture( - params=[ - pytest.param(("asyncio", {"use_uvloop": False}), id="asyncio"), - pytest.param(("asyncio", {"use_uvloop": True}), id="asyncio-uvloop"), - pytest.param( - ("trio", {"restrict_keyboard_interrupt_to_checkpoints": True}), id="trio" - ), - ], - scope="session", -) + +@pytest.fixture(params=anyio_params, scope="session") def anyio_backend(request: pytest.FixtureRequest) -> tuple[str, dict[str, Any]]: return request.param