From 4bcd5ff2345fb4dd1414cbc486fe5addde998159 Mon Sep 17 00:00:00 2001 From: Peter Mitri Date: Tue, 25 Feb 2025 14:32:29 +0100 Subject: [PATCH] review --- src/tests/cucumber/features/environment.py | 10 +++++++--- .../cucumber/features/steps/common_steps/steps.py | 1 - 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tests/cucumber/features/environment.py b/src/tests/cucumber/features/environment.py index 98336ced3e..94ffa01d6e 100644 --- a/src/tests/cucumber/features/environment.py +++ b/src/tests/cucumber/features/environment.py @@ -1,5 +1,7 @@ # This file defines behave hooks to run before all tests -import shutil +import os.path +import pathlib +from shutil import rmtree def before_all(context): check_userdata_exists(context, "antares-solver") @@ -12,5 +14,7 @@ def check_userdata_exists(context, data_name: str): def after_scenario(context, scenario): # post-processing a test: clean up output files to avoid taking up all the disk space - if (context.output_path != None): - shutil.rmtree(context.output_path) \ No newline at end of file + if context.output_path != None: + rmtree(context.output_path) + if os.path.exists(os.path.join(context.study_path, "logs")): + rmtree(os.path.join(context.study_path, "logs")) \ No newline at end of file diff --git a/src/tests/cucumber/features/steps/common_steps/steps.py b/src/tests/cucumber/features/steps/common_steps/steps.py index 30fe33ecb9..9d69b6918e 100644 --- a/src/tests/cucumber/features/steps/common_steps/steps.py +++ b/src/tests/cucumber/features/steps/common_steps/steps.py @@ -1,7 +1,6 @@ # Gherkins test steps definitions import os -import pathlib from behave import * from common_steps.assertions import *