def destroy(self): """Remove all of the test environment data.""" env = EnvironmentStub(path=self.tracdir, destroying=True) env.destroy_db() env.shutdown() self.destroy_repo() if os.path.exists(self.dirname): rmtree(self.dirname)
def destroy(self): self._shutdown_environment() self._destroy_database(self.get_db_url()) if os.path.exists(self.dirname): for i in range(5): try: rmtree(self.dirname) break except OSError: # The idea is that sometimes we need to wait for a short # time until all file handles are closed (e.g. tracd is # really shut down) so that we can delete the files on # Windows. time.sleep(0.5)