(coro)
| 361 | sock.close() |
| 362 | |
| 363 | def run(coro): |
| 364 | nonlocal CNT |
| 365 | CNT = 0 |
| 366 | |
| 367 | async def _gather(*tasks): |
| 368 | # trampoline |
| 369 | return await asyncio.gather(*tasks) |
| 370 | |
| 371 | with self.tcp_server(server, |
| 372 | max_clients=TOTAL_CNT, |
| 373 | backlog=TOTAL_CNT) as srv: |
| 374 | tasks = [] |
| 375 | for _ in range(TOTAL_CNT): |
| 376 | tasks.append(coro(srv.addr)) |
| 377 | |
| 378 | self.loop.run_until_complete(_gather(*tasks)) |
| 379 | |
| 380 | self.assertEqual(CNT, TOTAL_CNT) |
| 381 | |
| 382 | with self._silence_eof_received_warning(): |
| 383 | run(client) |
no test coverage detected