Skip to content

Commit 45da4d2

Browse files
committed
test: fix test_create_connection_happy_eyeballs_empty_exceptions to be synchronous and check correct error message
1 parent 2b5e199 commit 45da4d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_asyncio/test_base_events.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ def getaddrinfo(*args, **kw):
11911191
self.assertTrue(sock.close.called)
11921192

11931193
@patch_socket
1194-
async def test_create_connection_happy_eyeballs_empty_exceptions(self, m_socket):
1194+
def test_create_connection_happy_eyeballs_empty_exceptions(self, m_socket):
11951195
# Test for gh-135836: Fix IndexError when Happy Eyeballs algorithm
11961196
# results in empty exceptions list
11971197

@@ -1221,8 +1221,8 @@ async def mock_race(coro_fns, delay, loop):
12211221
MyProto, 'example.com', 80, happy_eyeballs_delay=0.1)
12221222

12231223
# Should raise TimeoutError instead of IndexError
1224-
with self.assertRaisesRegex(TimeoutError, "connection timed out"):
1225-
await coro
1224+
with self.assertRaisesRegex(TimeoutError, "create_connection failed"):
1225+
self.loop.run_until_complete(coro)
12261226

12271227
def test_create_connection_host_port_sock(self):
12281228
# host, port and sock are specified

0 commit comments

Comments
 (0)