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

Method setUp

Lib/test/test_socket.py:5081–5093  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5079 # when a timeout is set.
5080
5081 def setUp(self):
5082 super().setUp()
5083 self.serv_conn = self.newSocket()
5084 self.addCleanup(self.serv_conn.close)
5085 # Use a thread to complete the connection, but wait for it to
5086 # terminate before running the test, so that there is only one
5087 # thread to accept the signal.
5088 cli_thread = threading.Thread(target=self.doConnect)
5089 cli_thread.start()
5090 self.cli_conn, addr = self.serv.accept()
5091 self.addCleanup(self.cli_conn.close)
5092 cli_thread.join()
5093 self.serv_conn.settimeout(self.timeout)
5094
5095 def doConnect(self):
5096 self.serv_conn.connect(self.serv_addr)

Callers

nothing calls this directly

Calls 8

startMethod · 0.95
joinMethod · 0.95
superClass · 0.85
addCleanupMethod · 0.80
setUpMethod · 0.45
newSocketMethod · 0.45
acceptMethod · 0.45
settimeoutMethod · 0.45

Tested by

no test coverage detected