@@ -944,8 +944,7 @@ def test_LimitOverrunError_pickleable(self):
944
944
class NewStreamTests2 (unittest .IsolatedAsyncioTestCase ):
945
945
async def test_wait_closed_on_close (self ):
946
946
with test_utils .run_test_server () as httpd :
947
- rd , wr = self .loop .run_until_complete (
948
- asyncio .open_connection (* httpd .address ))
947
+ rd , wr = await asyncio .open_connection (* httpd .address )
949
948
950
949
wr .write (b'GET / HTTP/1.0\r \n \r \n ' )
951
950
data = await rd .readline ()
@@ -962,8 +961,7 @@ async def test_wait_closed_on_close_with_unread_data(self):
962
961
rd , wr = await asyncio .open_connection (* httpd .address )
963
962
964
963
wr .write (b'GET / HTTP/1.0\r \n \r \n ' )
965
- f = rd .readline ()
966
- data = self .loop .run_until_complete (f )
964
+ data = await rd .readline ()
967
965
self .assertEqual (data , b'HTTP/1.0 200 OK\r \n ' )
968
966
wr .close ()
969
967
await wr .wait_closed ()
@@ -1005,11 +1003,9 @@ async def test_eof_feed_when_closing_writer(self):
1005
1003
with test_utils .run_test_server () as httpd :
1006
1004
rd , wr = await asyncio .open_connection (* httpd .address )
1007
1005
wr .close ()
1008
- f = wr .wait_closed ()
1009
- self .loop .run_until_complete (f )
1006
+ await wr .wait_closed ()
1010
1007
self .assertTrue (rd .at_eof ())
1011
- f = rd .read ()
1012
- data = self .loop .run_until_complete (f )
1008
+ data = await rd .read ()
1013
1009
self .assertEqual (data , b'' )
1014
1010
1015
1011
0 commit comments