diff --git a/.github/codecov.yml b/.github/codecov.yml index 7293e6e81..c18520489 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -1,7 +1,7 @@ comment: require_changes: false # Always show messages if codecov is triggered layout: "flags" # Only show coverage by flags - after_n_builds: 8 # nb_tested_python_version(==2) * (nb_tested_platforms(==3) + nb_unit_test_runs(==1)) + after_n_builds: 10 # nb_tested_python_version(==2) * (nb_functional_test_runs(==3) + nb_unit_test_runs(==2)) coverage: status: project: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c2075169d..d61f62000 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,10 +43,11 @@ jobs: if: | (github.event_name != 'push' || !startsWith(github.event.head_commit.message, 'Bump version:')) && (github.event_name != 'pull_request' || github.event.pull_request.draft != true) - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: + os: [ubuntu-22.04, windows-2022] python_version: ['3.11', '3.12'] steps: diff --git a/src/easynetwork/lowlevel/asyncio/backend.py b/src/easynetwork/lowlevel/asyncio/backend.py index 5b4c7b785..2cf894a59 100644 --- a/src/easynetwork/lowlevel/asyncio/backend.py +++ b/src/easynetwork/lowlevel/asyncio/backend.py @@ -90,11 +90,7 @@ def get_cancelled_exc_class(self) -> type[BaseException]: async def ignore_cancellation(self, coroutine: Coroutine[Any, Any, _T_co]) -> _T_co: if not asyncio.iscoroutine(coroutine): raise TypeError("Expected a coroutine object") - if sys.version_info >= (3, 12): - context = TaskUtils.current_asyncio_task().get_context() - else: - context = None - return await TaskUtils.cancel_shielded_await_task(asyncio.create_task(coroutine, context=context)) + return await TaskUtils.cancel_shielded_await_task(asyncio.create_task(coroutine)) def open_cancel_scope(self, *, deadline: float = math.inf) -> CancelScope: return CancelScope(deadline=deadline) diff --git a/tests/functional_test/test_async/test_backend/test_asyncio_backend.py b/tests/functional_test/test_async/test_backend/test_asyncio_backend.py index 19681d492..28532a7ac 100644 --- a/tests/functional_test/test_async/test_backend/test_asyncio_backend.py +++ b/tests/functional_test/test_async/test_backend/test_asyncio_backend.py @@ -131,21 +131,6 @@ async def self_cancellation() -> None: await task assert task.cancelled() - @pytest.mark.xfail("sys.version_info < (3, 12)", reason="asyncio.Task.get_context() does not exist before Python 3.12") - async def test____ignore_cancellation____share_same_context_with_host_task( - self, - backend: AsyncIOBackend, - ) -> None: - async def coroutine() -> None: - await asyncio.sleep(0.1) - - cvar_for_test.set("after_in_coroutine") - - cvar_for_test.set("before_in_current_task") - await backend.ignore_cancellation(coroutine()) - - assert cvar_for_test.get() == "after_in_coroutine" - async def test____timeout____respected( self, backend: AsyncIOBackend,