Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore platform/version specific trio failures #3922

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/unit/test_concurrency.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import asyncio
import sys
from concurrent.futures import ThreadPoolExecutor
from typing import Generator
from unittest.mock import AsyncMock
Expand Down Expand Up @@ -37,6 +38,7 @@ def test_sync_to_thread_asyncio() -> None:
assert loop.run_until_complete(sync_to_thread(func)) == 1


@pytest.mark.xfail(sys.platform == "win32", reason="Trio has issues with thread handling on Windows")
def test_sync_to_thread_trio() -> None:
assert trio.run(sync_to_thread, func) == 1

Expand Down Expand Up @@ -78,6 +80,7 @@ async def main() -> None:
assert get_asyncio_executor() is None


@pytest.mark.xfail(sys.platform == "win32", reason="Trio has issues with thread handling on Windows")
def test_trio_uses_limiter(mocker: MockerFixture) -> None:
limiter = trio.CapacityLimiter(10)
mocker.patch("litestar.concurrency.get_trio_capacity_limiter", return_value=limiter)
Expand All @@ -88,6 +91,7 @@ def test_trio_uses_limiter(mocker: MockerFixture) -> None:
assert mock_run_sync.call_args_list[0].kwargs["limiter"] is limiter


@pytest.mark.xfail(sys.platform == "win32", reason="Trio has issues with thread handling on Windows")
def test_set_trio_capacity_limiter_from_async_context_raises() -> None:
async def main() -> None:
set_trio_capacity_limiter(trio.CapacityLimiter(1))
Expand Down
Loading