From aaffd0eae06b9b692c9e8c986a1cf212ff071bd9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
Date: Tue, 11 Jan 2022 01:16:51 +0200
Subject: [PATCH] Fixed test suite failing on Python 3.11
---
tests/test_debugging.py | 2 ++
tests/test_taskgroups.py | 2 ++
2 files changed, 4 insertions(+)
diff --git a/tests/test_debugging.py b/tests/test_debugging.py
index f826238e..43caed2f 100644
--- a/tests/test_debugging.py
+++ b/tests/test_debugging.py
@@ -83,6 +83,8 @@ async def inspect() -> None:
assert repr(task) == f'TaskInfo(id={task.id}, name={expected_name!r})'
+@pytest.mark.skipif(sys.version_info >= (3, 11),
+ reason='Generator based coroutines have been removed in Python 3.11')
@pytest.mark.filterwarnings('ignore:"@coroutine" decorator is deprecated:DeprecationWarning')
def test_wait_generator_based_task_blocked(asyncio_event_loop: asyncio.AbstractEventLoop) -> None:
async def native_coro_part() -> None:
diff --git a/tests/test_taskgroups.py b/tests/test_taskgroups.py
index e19133ce..528aa2a5 100644
--- a/tests/test_taskgroups.py
+++ b/tests/test_taskgroups.py
@@ -807,6 +807,8 @@ async def test_escaping_cancelled_error_from_cancelled_task() -> None:
scope.cancel()
+@pytest.mark.skipif(sys.version_info >= (3, 11),
+ reason='Generator based coroutines have been removed in Python 3.11')
@pytest.mark.filterwarnings('ignore:"@coroutine" decorator is deprecated:DeprecationWarning')
def test_cancel_generator_based_task() -> None:
from asyncio import coroutine