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

Method setUp

Lib/test/test_ftplib.py:1049–1061  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1047class TestTimeouts(TestCase):
1048
1049 def setUp(self):
1050 self.evt = threading.Event()
1051 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1052 self.sock.settimeout(20)
1053 self.port = socket_helper.bind_port(self.sock)
1054 self.server_thread = threading.Thread(target=self.server)
1055 self.server_thread.daemon = True
1056 self.server_thread.start()
1057 # Wait for the server to be ready.
1058 self.evt.wait()
1059 self.evt.clear()
1060 self.old_port = ftplib.FTP.port
1061 ftplib.FTP.port = self.port
1062
1063 def tearDown(self):
1064 ftplib.FTP.port = self.old_port

Callers

nothing calls this directly

Calls 6

EventMethod · 0.80
socketMethod · 0.80
settimeoutMethod · 0.45
startMethod · 0.45
waitMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected