Skip to content

Commit

Permalink
shutil.rmtree(..., ignore_errors=True) for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Feb 17, 2024
1 parent f72d122 commit 592aaf2
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/fluidimage/postproc/test_piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
if cls.path_tests.exists():
rmtree(cls.path_tests)
rmtree(cls.path_tests, ignore_errors=True)

def test_get_grid(self):
xs1d, ys1d = get_grid_pixel_from_piv_file(self.path_piv)
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/reconstruct/tomo/mlos.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _estimate_max_array_size(dtype=np.float64):
particle_images = path_image_samples / "TomoPIV" / "particle"
output_dir = path_image_samples / "TomoPIV" / "tomo"
if output_dir.exists():
shutil.rmtree(output_dir)
shutil.rmtree(output_dir, ignore_errors=True)

for cam in tomo.cams:
print(f"Projecting {cam}...")
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/reconstruct/tomo/test_mlos.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TestMLOS(unittest.TestCase):
"""Test fluidimage.reconstruct.tomo.mlos module."""

def tearDown(self):
shutil.rmtree(path_output)
shutil.rmtree(path_output, ignore_errors=True)

def test(self):
"""Test classes TomoMLOSCV and ArrayTomoCV."""
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/topologies/test_bos.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def tearDownClass(cls):
path = cls.path_input_files
path_out = Path(str(path) + "." + cls.postfix)
if path_out.exists():
rmtree(path_out)
rmtree(path_out, ignore_errors=True)

def test_bos_new_multiproc(self):
params = TopologyBOS.create_default_params()
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/topologies/test_image2image.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def setUpClass(cls):
def tearDownClass(cls):
path_out = Path(str(cls.path_src) + "." + cls.postfix)
if path_out.exists():
rmtree(path_out)
rmtree(path_out, ignore_errors=True)

def test_piv_new(self):
params = TopologyImage2Image.create_default_params()
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/topologies/test_optical_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def tearDownClass(cls):
for path in paths:
path_out = Path(str(path.parent) + "." + cls.postfix)
if path_out.exists():
rmtree(path_out)
rmtree(path_out, ignore_errors=True)

def test_optical_flow(self):
params = TopologyOpticalFlow.create_default_params()
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/topologies/test_piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def tearDownClass(cls):
for path in paths:
path_out = Path(str(path.parent) + "." + cls.postfix)
if path_out.exists():
rmtree(path_out)
rmtree(path_out, ignore_errors=True)

def test_piv_new(self):
params = TopologyPIV.create_default_params()
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/topologies/test_surftracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def setUpClass(cls):
def tearDownClass(cls):
# path_out = Path(str(cls.path_src) + "." + cls.postfix)
if cls.path_out.exists():
rmtree(cls.path_out)
rmtree(cls.path_out, ignore_errors=True)

def test_surftrack(self):
params = TopologySurfaceTracking.create_default_params()
Expand Down
2 changes: 1 addition & 1 deletion src/fluidimage/works/piv/test_piv.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def setUpClass(cls):
@classmethod
def tearDownClass(cls):
if cls.path_tmp.exists():
rmtree(cls.path_tmp)
rmtree(cls.path_tmp, ignore_errors=True)

def test_minimal_piv(self):
params = WorkPIV.create_default_params()
Expand Down

0 comments on commit 592aaf2

Please sign in to comment.