test: Add cleanup for generated files

This commit is contained in:
Gavin D'souza 2022-08-08 15:09:21 +05:30
parent 624c308659
commit 208e33afa6
2 changed files with 5 additions and 1 deletions

View file

@ -51,4 +51,7 @@ class TestPrintFormat(unittest.TestCase):
for key, value in exported_doc.items():
if key in doc_dict:
self.assertEqual(value, doc_dict[key])
with self.subTest(key=key):
self.assertEqual(value, doc_dict[key])
self.addCleanup(os.remove, exported_doc_path)

View file

@ -60,6 +60,7 @@ class TestUtils(FrappeTestCase):
self.custom_field.delete()
trim_table("Note", dry_run=False)
delattr(self, "custom_field")
delete_path(frappe.get_module_path("Desk", "Note"))
if self._testMethodName == "test_export_doc":
self.note.delete()