From eae4b4f62a3168952f32d2793ac872b36b03c59d Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Tue, 9 Mar 2021 00:22:18 +0100 Subject: [PATCH] The tmp_file fixture destructor should clean up any temporary files (in case multiple tests import it) --- tests/test_cron.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/test_cron.py b/tests/test_cron.py index 30620d9913..c7a76a8735 100644 --- a/tests/test_cron.py +++ b/tests/test_cron.py @@ -18,8 +18,9 @@ def tmp_file(*_): tmp_files_ready.set() yield tmp_file.name - if os.path.isfile(tmp_files[0]): - os.unlink(tmp_files[0]) + for f in tmp_files: + if os.path.isfile(f): + os.unlink(f) def test_cron_execution(tmp_file):