def __exit__(self, exc_type, exc_val, exc_tb): """ Context manager interface to exit with-as context. Returns False to propagate potential exception, else True. """ self.log("Cleaning up", self.log.INFO) self.errlog.close() self.log.close_logfile() if self.security != "server": SetConnections.CloseConnections() return False
def __exit__(self, exc_type, exc_val, exc_tb): """ Context manager interface to exit with-as context. Returns False to propagate potential exception, else True. """ log.Log("Cleaning up", log.INFO) if hasattr(self, 'repo'): self.repo.exit() if self.security != "server": log.ErrorLog.close() log.Log.close_logfile() SetConnections.CloseConnections() return False
def tearDown(self): print "Taking down connections" SetConnections.CloseConnections()