MCPcopy Index your code
hub / github.com/python/cpython / run

Method run

Lib/test/test_asyncio/test_ssl.py:363–380  ·  view source on GitHub ↗
(coro)

Source from the content-addressed store, hash-verified

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)

Calls 4

tcp_serverMethod · 0.95
appendMethod · 0.45
run_until_completeMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected