Skip to content

Commit b2327b6

Browse files
committed
PYTHON-4782 Fix tests
1 parent 45ca439 commit b2327b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/asynchronous/test_locks.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,9 @@ async def test_timeout_in_block(self):
299299
with self.assertRaises(asyncio.TimeoutError):
300300
await asyncio.wait_for(condition.wait(), timeout=0.5)
301301

302+
@unittest.skipIf(
303+
sys.version_info < (3, 11), "raising the same cancelled error requires Python>=3.11"
304+
)
302305
async def test_cancelled_error_wakeup(self):
303306
# Test that a cancelled error, received when awaiting wakeup,
304307
# will be re-raised un-modified.
@@ -325,6 +328,9 @@ async def func():
325328
# originally raised.
326329
self.assertIs(err.exception, raised)
327330

331+
@unittest.skipIf(
332+
sys.version_info < (3, 11), "raising the same cancelled error requires Python>=3.11"
333+
)
328334
async def test_cancelled_error_re_aquire(self):
329335
# Test that a cancelled error, received when re-aquiring lock,
330336
# will be re-raised un-modified.
@@ -357,6 +363,7 @@ async def func():
357363
# originally raised.
358364
self.assertIs(err.exception, raised)
359365

366+
@unittest.skipIf(sys.version_info < (3, 11), "asyncio.timeout requires Python>=3.11")
360367
async def test_cancelled_wakeup(self):
361368
# Test that a task cancelled at the "same" time as it is woken
362369
# up as part of a Condition.notify() does not result in a lost wakeup.
@@ -402,6 +409,7 @@ async def consumer():
402409
condition.notify_all()
403410
await c[1]
404411

412+
@unittest.skipIf(sys.version_info < (3, 11), "asyncio.timeout requires Python>=3.11")
405413
async def test_cancelled_wakeup_relock(self):
406414
# Test that a task cancelled at the "same" time as it is woken
407415
# up as part of a Condition.notify() does not result in a lost wakeup.

0 commit comments

Comments
 (0)