From 7c1256a30212279d8fc9846eeb475fa6ec728afa Mon Sep 17 00:00:00 2001 From: william-andre Date: Wed, 15 Nov 2023 21:20:57 +0100 Subject: [PATCH] [FIX] tests: do not `assertQueries` before warmup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just like for `assertQueryCount`, we should not take into account queries that are not run after a warmup, for consistency. This allows to easily interchange both context managers for debugging purpose for instance. closes odoo/odoo#142450 X-original-commit: aaa1d287085c8b2fe20b6591ca9f1b5bbe65d3db Signed-off-by: Raphael Collet Signed-off-by: William André (wan) --- odoo/tests/common.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/odoo/tests/common.py b/odoo/tests/common.py index 9cbb87ae686..21e7ae5b417 100644 --- a/odoo/tests/common.py +++ b/odoo/tests/common.py @@ -482,6 +482,9 @@ class BaseCase(case.TestCase, metaclass=MetaCase): self.env.flush_all() self.env.cr.flush() + if not self.warm: + return + self.assertEqual( len(actual_queries), len(expected), "\n---- actual queries:\n%s\n---- expected queries:\n%s" % (