From 2124443bdbaa32bbb21731a75888c0fee88d0bce Mon Sep 17 00:00:00 2001 From: Daniil Kazantsev Date: Fri, 3 Jul 2020 16:50:01 +0100 Subject: [PATCH] adding rmtree with ignore flag --- savu/test/base_checkpoint_test.py | 11 +++++++---- .../plugin_tests/loader_tests/template_loader_test.py | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/savu/test/base_checkpoint_test.py b/savu/test/base_checkpoint_test.py index a7e0c32b5..06a1ab6bc 100644 --- a/savu/test/base_checkpoint_test.py +++ b/savu/test/base_checkpoint_test.py @@ -27,6 +27,7 @@ import unittest import numpy as np from shutil import copyfile +import shutil from savu.core.plugin_runner import PluginRunner from savu.core.checkpointing import Checkpointing @@ -58,10 +59,12 @@ def setUp(self): def tearDown(self): cp_folder = os.path.join(self.tmpdir, 'checkpoint') - self._empty_folder(cp_folder) - os.removedirs(cp_folder) - self._empty_folder(self.tmpdir) - os.removedirs(self.tmpdir) + #self._empty_folder(cp_folder) + #os.removedirs(cp_folder) + #self._empty_folder(self.tmpdir) + #os.removedirs(self.tmpdir) + shutil.rmtree(cp_folder, ignore_errors=True) + shutil.rmtree(self.tmpdir, ignore_errors=True) def _empty_folder(self, folder): for f in os.listdir(folder): diff --git a/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py b/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py index cf8f270a3..621235554 100644 --- a/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py +++ b/savu/test/travis/plugin_tests/loader_tests/template_loader_test.py @@ -217,7 +217,7 @@ def setUp(self): def tearDown(self): - shutil.rmtree(self.test_folder) + shutil.rmtree(self.test_folder, ignore_errors=True) def create_N_tiffs(self, N, file_pattern='%04d.tif', frame_size=(10, 13)): '''