From 96c0f1ec4d95966e2a6bf302c1b2b4f6bbee5fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 19 Feb 2023 22:13:35 +0100 Subject: [PATCH] Rollback and clear tasks on database error in transaction of tests --- trytond/trytond/tests/test_tryton.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/trytond/trytond/tests/test_tryton.py b/trytond/trytond/tests/test_tryton.py index 61b8aaf29f..a537fdcb24 100644 --- a/trytond/trytond/tests/test_tryton.py +++ b/trytond/trytond/tests/test_tryton.py @@ -222,6 +222,8 @@ def with_transaction(user=1, context=None): try: result = func(*args, **kwargs) except TransactionError as e: + transaction.rollback() + transaction.tasks.clear() e.fix(extras) continue finally: