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

Method setUp

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

Source from the content-addressed store, hash-verified

5182 # when a timeout is set.
5183
5184 def setUp(self):
5185 super().setUp()
5186 self.serv_conn = self.newSocket()
5187 self.addCleanup(self.serv_conn.close)
5188 # Use a thread to complete the connection, but wait for it to
5189 # terminate before running the test, so that there is only one
5190 # thread to accept the signal.
5191 cli_thread = threading.Thread(target=self.doConnect)
5192 cli_thread.start()
5193 self.cli_conn, addr = self.serv.accept()
5194 self.addCleanup(self.cli_conn.close)
5195 cli_thread.join()
5196 self.serv_conn.settimeout(self.timeout)
5197
5198 def doConnect(self):
5199 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