From 6e8352e847cd592bfd257f133e28ebf7b29376da Mon Sep 17 00:00:00 2001 From: Leonardo Grasso Date: Fri, 9 Oct 2020 13:11:01 +0200 Subject: [PATCH] chore(test): cleanup tmp file Signed-off-by: Leonardo Grasso --- test/falco_test.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/falco_test.py b/test/falco_test.py index e1c43f54..c9d845a5 100644 --- a/test/falco_test.py +++ b/test/falco_test.py @@ -224,6 +224,9 @@ class FalcoTest(Test): output['actual'] = key output['expected'] = value output_strictly_contains.append(output) + # Clean up file from previous tests, if any + if not output['actual'] == 'stdout' and os.path.exists(output['actual']): + os.remove(output['actual']) filedir = os.path.dirname(output['expected']) # Create the parent directory for the file if it doesn't exist. if not os.path.isdir(filedir):