refactor(test): move commits inside test guard clause

This commit is contained in:
ruthra kumar
2026-03-20 11:46:43 +05:30
parent cd5b0ea5fd
commit ed76d6699a
11 changed files with 28 additions and 13 deletions

View File

@@ -62,7 +62,9 @@ def book_depreciation_entries(date):
accounting_dimensions,
)
frappe.db.commit()
if not frappe.in_test:
frappe.db.commit()
except Exception as e:
frappe.db.rollback()
failed_assets.append(asset_name)
@@ -72,7 +74,8 @@ def book_depreciation_entries(date):
if failed_assets:
set_depr_entry_posting_status_for_failed_assets(failed_assets)
notify_depr_entry_posting_error(failed_assets, error_logs)
frappe.db.commit()
if not frappe.in_test:
frappe.db.commit()
def get_depreciable_assets_data(date):