From 65b719eead9e616a784e9f1a8183ba016683e0a7 Mon Sep 17 00:00:00 2001 From: Norman Fomferra Date: Tue, 13 Feb 2024 09:03:14 +0100 Subject: [PATCH] Delete test files --- tests/test_api.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/test_api.py b/tests/test_api.py index 993d6d7..7815688 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -94,11 +94,18 @@ def test_some_slices_local_output_to_non_existing_dir(self): ] for uri in slices: make_test_dataset(uri=uri) - with pytest.raises( - FileNotFoundError, - match="\\ATarget parent directory does not exist: .*/non_existent_dir\\Z", - ): - zappend(slices, target_dir=target_dir) + try: + with pytest.raises( + FileNotFoundError, + match=( + "\\ATarget parent directory does not exist: .*/non_existent_dir\\Z" + ), + ): + zappend(slices, target_dir=target_dir) + finally: + shutil.rmtree(target_dir, ignore_errors=True) + for slice_dir in slices: + shutil.rmtree(slice_dir, ignore_errors=True) def test_some_slices_with_class_slice_source(self): target_dir = "memory://target.zarr"