The tmp_file fixture destructor should clean up any temporary files (in case multiple tests import it)

This commit is contained in:
Fabio Manganiello 2021-03-09 00:22:18 +01:00
parent 296458ece3
commit eae4b4f62a
1 changed files with 3 additions and 2 deletions

View File

@ -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):