Skip to content

Commit

Permalink
clean up after tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rpreen committed Jun 10, 2024
1 parent 92ee6ab commit 414717c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import shutil
from datetime import date

import numpy as np
import pytest
Expand Down Expand Up @@ -42,7 +43,6 @@
files = [
"1024-WorstCase.png",
"2048-WorstCase.png",
"ATTACK_RESULTS09_06_2024.json",
"attack.txt",
"config.json",
"config_structural_test.json",
Expand Down Expand Up @@ -75,11 +75,17 @@
def _cleanup():
"""Remove created files and directories."""
yield

for folder in folders:
try:
shutil.rmtree(folder)
except Exception: # pylint: disable=broad-exception-caught
pass

files.append( # from attack_report_formater.py
"ATTACK_RESULTS" + str(date.today().strftime("%d_%m_%Y")) + ".json"
)

for file in files:
try:
os.remove(file)
Expand Down

0 comments on commit 414717c

Please sign in to comment.