File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1092,7 +1092,11 @@ async def sock_connect(sock, address):
10921092 await asyncio .sleep (1 )
10931093 sock .connect (address )
10941094
1095- loop = asyncio .new_event_loop ()
1095+ # gh-151540: use a selector event loop instead of the platform
1096+ # default; the Windows proactor loop would register the mocked
1097+ # socket with a real IOCP handle instead of the mocked
1098+ # _add_reader/_add_writer below.
1099+ loop = asyncio .SelectorEventLoop ()
10961100 loop ._add_writer = mock .Mock ()
10971101 loop ._add_writer = mock .Mock ()
10981102 loop ._add_reader = mock .Mock ()
@@ -1124,7 +1128,8 @@ async def sock_connect(sock, address):
11241128 await asyncio .sleep (1 )
11251129 sock .connect (address )
11261130
1127- loop = asyncio .new_event_loop ()
1131+ # gh-151540: see test_create_connection_happy_eyeballs above.
1132+ loop = asyncio .SelectorEventLoop ()
11281133 loop ._add_writer = mock .Mock ()
11291134 loop ._add_writer = mock .Mock ()
11301135 loop ._add_reader = mock .Mock ()
You can’t perform that action at this time.
0 commit comments