From c06b1ede4cd7d4dfa87447a044f2de1fb905b68d Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Fri, 16 Sep 2022 11:32:04 +0000 Subject: [PATCH] [IMP] standalone: log exception when standalone fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently the exception is not logged using the logger meaning that the only indication of the failure is the "module not loaded" error message. Catching the exception to log it the proper way will help identifying the cause of the issue, mainly for uninstall tests. closes odoo/odoo#100431 X-original-commit: b16f850d9aa438aea91b8cbd7c33692e1e1b2f90 Signed-off-by: Xavier Dollé (xdo) --- odoo/tests/test_module_operations.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/odoo/tests/test_module_operations.py b/odoo/tests/test_module_operations.py index 3125b471f00..935be2fc9b6 100755 --- a/odoo/tests/test_module_operations.py +++ b/odoo/tests/test_module_operations.py @@ -163,9 +163,12 @@ if __name__ == '__main__': logging.getLogger('odoo.modules.loading').setLevel(logging.CRITICAL) logging.getLogger('odoo.sql_db').setLevel(logging.CRITICAL) - if args.uninstall: - test_uninstall(args) - elif args.standalone: - test_scripts(args) - else: - test_full(args) + try: + if args.uninstall: + test_uninstall(args) + elif args.standalone: + test_scripts(args) + else: + test_full(args) + except Exception as e: + _logger.exception("An error occured during standalone tests: %s", e)