MCPcopy Index your code
hub / github.com/RustPython/RustPython / asyncSetUp

Method asyncSetUp

Lib/test/test_os.py:3840–3850  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3838 self.server.close() # The test server processes a single client only
3839
3840 async def asyncSetUp(self):
3841 self.server_buffer = b''
3842 self.server = await asyncio.start_server(self.handle_new_client,
3843 socket_helper.HOSTv4)
3844 server_name = self.server.sockets[0].getsockname()
3845 self.client = socket.socket()
3846 self.client.setblocking(False)
3847 await asyncio.get_running_loop().sock_connect(self.client, server_name)
3848 self.sockno = self.client.fileno()
3849 self.file = open(os_helper.TESTFN, 'rb')
3850 self.fileno = self.file.fileno()
3851
3852 async def asyncTearDown(self):
3853 self.file.close()

Callers

nothing calls this directly

Calls 7

socketMethod · 0.80
openFunction · 0.50
start_serverMethod · 0.45
getsocknameMethod · 0.45
setblockingMethod · 0.45
sock_connectMethod · 0.45
filenoMethod · 0.45

Tested by

no test coverage detected