From 9a9a25dcce29a3eb2a219edd8c6b5bb1d86b65ce Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 7 Jan 2023 21:37:23 +0100 Subject: [PATCH] remove tmp directory if exists --- tests/test_1_flattener.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/test_1_flattener.py b/tests/test_1_flattener.py index 02a191a51..6bed1ffb8 100644 --- a/tests/test_1_flattener.py +++ b/tests/test_1_flattener.py @@ -4,6 +4,7 @@ from pytest import fixture, raises from os import listdir, environ, makedirs from json import load, dumps, loads from yaml import dump as ydump +from shutil import rmtree environ['TIRAMISU_LOCALE'] = 'en' @@ -14,6 +15,11 @@ from rougail.error import DictConsistencyError dico_dirs = 'tests/dictionaries' +# if test_3_template.py failed, this temporary directory must be removed +tmp_dir = join(dico_dirs, 'tmp') +if isdir(tmp_dir): + rmtree(tmp_dir) + test_ok = set() test_raise = set()