Skip to content

Commit 45d0725

Browse files
fix test as wait_for no longer creates
a new task so no sleep is required
1 parent 68391f8 commit 45d0725

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Lib/test/test_asyncio/test_waitfor.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ async def inner():
237237
with self.assertRaises(FooException):
238238
await foo()
239239

240-
@unittest.skip("TODO")
241240
async def test_wait_for_self_cancellation(self):
241+
loop = asyncio.get_running_loop()
242242
async def inner():
243243
try:
244244
await asyncio.sleep(0.3)
@@ -257,7 +257,6 @@ async def inner():
257257
# Test that wait_for itself is properly cancellable
258258
# even when the initial task holds up the initial cancellation.
259259
task = asyncio.create_task(wait)
260-
await asyncio.sleep(0.2)
261260
task.cancel()
262261

263262
with self.assertRaises(asyncio.CancelledError):

0 commit comments

Comments
 (0)