Commit 6e81f35
committed
gh-151540: Use a selector event loop in the happy-eyeballs tests
test_create_connection_happy_eyeballs and
test_create_connection_happy_eyeballs_ipv4_only used
asyncio.new_event_loop(), which defaults to ProactorEventLoop on
Windows. Creating a socket transport on that loop registers the
mocked socket with a real I/O completion port, bypassing the
mocked _add_reader/_add_writer and failing in a callback with
"TypeError: an integer is required" because MagicMock.fileno()
does not return an int.
Use asyncio.SelectorEventLoop() explicitly instead, matching the
code path these tests already exercise on non-Windows platforms.1 parent b2d8db1 commit 6e81f35
2 files changed
Lines changed: 12 additions & 2 deletions
File tree
- Lib/test/test_asyncio
- Misc/NEWS.d/next/Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1092 | 1092 | | |
1093 | 1093 | | |
1094 | 1094 | | |
1095 | | - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1096 | 1100 | | |
1097 | 1101 | | |
1098 | 1102 | | |
| |||
1124 | 1128 | | |
1125 | 1129 | | |
1126 | 1130 | | |
1127 | | - | |
| 1131 | + | |
| 1132 | + | |
1128 | 1133 | | |
1129 | 1134 | | |
1130 | 1135 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments