Skip to content

Commit

Permalink
Remove more asyncio.open_connection()
Browse files Browse the repository at this point in the history
  • Loading branch information
arhadthedev authored Oct 5, 2022
1 parent bc21d76 commit 87e841c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions Lib/test/test_asyncio/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,7 @@ def test_LimitOverrunError_pickleable(self):
class NewStreamTests2(unittest.IsolatedAsyncioTestCase):
async def test_wait_closed_on_close(self):
with test_utils.run_test_server() as httpd:
rd, wr = self.loop.run_until_complete(
asyncio.open_connection(*httpd.address))
rd, wr = await asyncio.open_connection(*httpd.address)

wr.write(b'GET / HTTP/1.0\r\n\r\n')
data = await rd.readline()
Expand All @@ -962,8 +961,7 @@ async def test_wait_closed_on_close_with_unread_data(self):
rd, wr = await asyncio.open_connection(*httpd.address)

wr.write(b'GET / HTTP/1.0\r\n\r\n')
f = rd.readline()
data = self.loop.run_until_complete(f)
data = await rd.readline()
self.assertEqual(data, b'HTTP/1.0 200 OK\r\n')
wr.close()
await wr.wait_closed()
Expand Down Expand Up @@ -1005,11 +1003,9 @@ async def test_eof_feed_when_closing_writer(self):
with test_utils.run_test_server() as httpd:
rd, wr = await asyncio.open_connection(*httpd.address)
wr.close()
f = wr.wait_closed()
self.loop.run_until_complete(f)
await wr.wait_closed()
self.assertTrue(rd.at_eof())
f = rd.read()
data = self.loop.run_until_complete(f)
data = await rd.read()
self.assertEqual(data, b'')


Expand Down

0 comments on commit 87e841c

Please sign in to comment.