Skip to content

Commit

Permalink
fix test as wait_for no longer creates
Browse files Browse the repository at this point in the history
a new task so no sleep is required
  • Loading branch information
kumaraditya303 authored Oct 21, 2022
1 parent 68391f8 commit 45d0725
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Lib/test/test_asyncio/test_waitfor.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ async def inner():
with self.assertRaises(FooException):
await foo()

@unittest.skip("TODO")
async def test_wait_for_self_cancellation(self):
loop = asyncio.get_running_loop()
async def inner():
try:
await asyncio.sleep(0.3)
Expand All @@ -257,7 +257,6 @@ async def inner():
# Test that wait_for itself is properly cancellable
# even when the initial task holds up the initial cancellation.
task = asyncio.create_task(wait)
await asyncio.sleep(0.2)
task.cancel()

with self.assertRaises(asyncio.CancelledError):
Expand Down

0 comments on commit 45d0725

Please sign in to comment.