()
| 1016 | new_tr.close() |
| 1017 | |
| 1018 | async def run_main(): |
| 1019 | on_con = self.loop.create_future() |
| 1020 | on_eof = self.loop.create_future() |
| 1021 | on_con_lost = self.loop.create_future() |
| 1022 | proto = ServerProto(on_con, on_eof, on_con_lost) |
| 1023 | |
| 1024 | server = await self.loop.create_server( |
| 1025 | lambda: proto, '127.0.0.1', 0) |
| 1026 | addr = server.sockets[0].getsockname() |
| 1027 | |
| 1028 | with self.tcp_client(lambda sock: client(sock, addr), |
| 1029 | timeout=self.TIMEOUT): |
| 1030 | await asyncio.wait_for( |
| 1031 | main(proto, on_con, on_eof, on_con_lost), |
| 1032 | timeout=self.TIMEOUT) |
| 1033 | |
| 1034 | server.close() |
| 1035 | await server.wait_closed() |
| 1036 | |
| 1037 | self.loop.run_until_complete(run_main()) |
| 1038 |
nothing calls this directly
no test coverage detected