diff --git a/vasl_templates/webapp/tests/test_counters.py b/vasl_templates/webapp/tests/test_counters.py index 09d55ef..a978b22 100644 --- a/vasl_templates/webapp/tests/test_counters.py +++ b/vasl_templates/webapp/tests/test_counters.py @@ -109,8 +109,9 @@ def test_counter_images( webapp ): # initialize check_dir = os.path.join( os.path.split(__file__)[0], "fixtures" ) save_dir = os.environ.get( "COUNTERS_SAVEDIR" ) # nb: define this to save the generated reports - if save_dir and os.path.isdir(save_dir): - shutil.rmtree( save_dir ) + if save_dir: + if os.path.isdir( save_dir ): + shutil.rmtree( save_dir ) os.makedirs( save_dir ) # test each VASL module file in the specified directory