Skip to content

Commit f7e4c4e

Browse files
committed
tests/tcp: Use server.wait_closed() to avoid ResourceWarnings
1 parent b89ba76 commit f7e4c4e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_tcp.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ async def start_server_sock():
117117
TIMEOUT, loop=self.loop)
118118

119119
srv.close()
120+
await srv.wait_closed()
120121

121122
# Check that the server cleaned-up proxy-sockets
122123
for srv_sock in srv_socks:
@@ -183,7 +184,9 @@ async def runner():
183184
srv = await self.loop.create_server(
184185
asyncio.Protocol,
185186
None, port)
187+
186188
srv.close()
189+
await srv.wait_closed()
187190

188191
self.loop.run_until_complete(runner())
189192

@@ -213,6 +216,9 @@ async def runner():
213216
srv1.close()
214217
srv2.close()
215218

219+
await srv1.wait_closed()
220+
await srv2.wait_closed()
221+
216222
self.loop.run_until_complete(runner())
217223

218224
def test_create_connection_1(self):

0 commit comments

Comments
 (0)