Skip to content

Commit

Permalink
adding rmtree with ignore flag
Browse files Browse the repository at this point in the history
  • Loading branch information
dkazanc committed Jul 3, 2020
1 parent 483916a commit 2124443
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions savu/test/base_checkpoint_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
'''
Expand Down

0 comments on commit 2124443

Please sign in to comment.