def __del__(self): if hasattr(self, 'ftp') and self.ftp: # pragma: no cover self.ftp.close() if hasattr(self, 'webdriver') and self.webdriver: unload_driver(self.webdriver) if hasattr(self, 'vdisplay') and self.vdisplay: unload_vdisplay(self.vdisplay)
def __exit__(self, *args, **kwargs): # pragma: no cover if hasattr(self, 'ftp'): self.ftp.close() if hasattr(self, 'webdriver'): unload_driver(self.webdriver) if hasattr(self, 'vdisplay'): unload_vdisplay(self.vdisplay) super(Cabu, self).__exit__(*args, **kwargs)