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

Method _cleanup

Lib/test/test_imaplib.py:307–321  ·  view source on GitHub ↗

Cleans up the test server. This method should not be called manually, it is added to the cleanup queue in the _setup method already.

(self)

Source from the content-addressed store, hash-verified

305 return self.client, self.server
306
307 def _cleanup(self):
308 """
309 Cleans up the test server. This method should not be called manually,
310 it is added to the cleanup queue in the _setup method already.
311 """
312 # if logout was called already we'd raise an exception trying to
313 # shutdown the client once again
314 if self.client is not None and self.client.state != 'LOGOUT':
315 self.client.shutdown()
316 # cleanup the server
317 self.server.shutdown()
318 self.server.server_close()
319 threading_helper.join_thread(self.thread)
320 # Explicitly clear the attribute to prevent dangling thread
321 self.thread = None
322
323 def test_EOF_without_complete_welcome_message(self):
324 # http://bugs.python.org/issue5949

Callers 5

tearDownMethod · 0.45
setUpModuleFunction · 0.45
run_python_until_endFunction · 0.45
kill_pythonFunction · 0.45

Calls 3

join_threadMethod · 0.80
shutdownMethod · 0.45
server_closeMethod · 0.45

Tested by

no test coverage detected