Skip to content

Commit 0598eed

Browse files
committed
Fix test for windows
1 parent 3567e94 commit 0598eed

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Lib/test/test_asyncio/test_tasks.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3691,7 +3691,14 @@ async def target():
36913691
await asyncio.sleep(0)
36923692

36933693
self.loop.run_until_complete(target())
3694-
self.assertEqual(0, len(self.loop._ready))
3694+
3695+
# For windows, it's likely to see asyncio.proactor_events
3696+
# .BaseProactorEventLoop._loop_self_reading as ready task
3697+
# We should filter it out.
3698+
ready_tasks = [
3699+
i for i in self.loop._ready
3700+
if i._callback.__name__ != "_loop_self_reading"]
3701+
self.assertEqual(0, len(ready_tasks))
36953702

36963703

36973704
class SleepTests(test_utils.TestCase):

0 commit comments

Comments
 (0)