From f4f006408d55f406270da288e94cf8f79134ec8a Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Thu, 21 Nov 2024 12:34:46 +0000 Subject: [PATCH] [FIX] base: fix test retry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since auto retry was disabled after the first failure, the test_retry test suite will systematicaly fail if another test fails before, adding confusing logs. Fix the way the retry count is detected to solve the issue. closes odoo/odoo#188144 X-original-commit: 09726302d9a591ca7db423dc9e30049df9913847 Signed-off-by: William Braeckman (wbr) Signed-off-by: Xavier Dollé (xdo) --- odoo/addons/base/tests/test_test_retry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/odoo/addons/base/tests/test_test_retry.py b/odoo/addons/base/tests/test_test_retry.py index 78f451bba15cd..65092e43a3ca0 100644 --- a/odoo/addons/base/tests/test_test_retry.py +++ b/odoo/addons/base/tests/test_test_retry.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo.tests import BaseCase, TransactionCase, tagged +from odoo.tests import BaseCase, TransactionCase, tagged, BaseCase from odoo.tests.common import _logger as test_logger import logging @@ -27,7 +27,7 @@ def runbot(message, *args): cls.startClassPatcher(patcher) def get_tests_run_count(self): - return int(os.environ.get('ODOO_TEST_FAILURE_RETRIES', 0)) + 1 + return BaseCase._tests_run_count def update_count(self): self.count = getattr(self, 'count', 0) + 1