Skip to content

Commit

Permalink
Added a test
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Dec 15, 2024
1 parent ebed14d commit fbf841e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_taskgroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import pytest
from exceptiongroup import catch
from pytest import FixtureRequest
from pytest import FixtureRequest, MonkeyPatch
from pytest_mock import MockerFixture

import anyio
Expand Down Expand Up @@ -1778,3 +1778,14 @@ async def sync_coro() -> None:
async with create_task_group() as tg:
tg.start_soon(sync_coro)
tg.cancel_scope.cancel()


@pytest.mark.parametrize("anyio_backend", ["asyncio"])
async def test_patched_asyncio_task(monkeypatch: MonkeyPatch) -> None:
monkeypatch.setattr(
asyncio,
"Task",
asyncio.tasks._PyTask, # type: ignore[attr-defined]
)
async with create_task_group() as tg:
tg.start_soon(sleep, 0)

0 comments on commit fbf841e

Please sign in to comment.