From 949e097165b50c223dcfec23b6e9c1825b7b7d39 Mon Sep 17 00:00:00 2001 From: Kenn Cartier Date: Tue, 10 Sep 2024 10:55:54 -0700 Subject: [PATCH] Delete populated directories during diretory cleanup --- tests/tools/general_tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/tools/general_tools.py b/tests/tools/general_tools.py index 2e29159..9e310b6 100644 --- a/tests/tools/general_tools.py +++ b/tests/tools/general_tools.py @@ -1,4 +1,5 @@ import os +import shutil import tempfile import numpy as np @@ -19,6 +20,8 @@ def remove_all_files_in_directory(directory): # Check if it is a file and remove it if os.path.isfile(file_path): os.remove(file_path) + else: + shutil.rmtree(file_path) except Exception as e: print(f"Error: {e}")