From 38aa1ee1ff9773955a142616c86dc5d1bafe30ea Mon Sep 17 00:00:00 2001 From: Prakhar Pratyush Date: Mon, 24 Oct 2022 11:34:32 +0530 Subject: [PATCH] test_classes: Improve assert_database_query_count output message. Output message should talk about both the cases: actual_count > expected_count and actual_count < expected_count. The message now includes information for the case where actual_query_count < expected_query_count. Fixes: #23325 --- zerver/lib/test_classes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zerver/lib/test_classes.py b/zerver/lib/test_classes.py index c5776e1652..b4c66c041b 100644 --- a/zerver/lib/test_classes.py +++ b/zerver/lib/test_classes.py @@ -1146,8 +1146,9 @@ Output: {count} queries expected, got {actual_count}. This is a performance-critical code path, where we check the number of database queries used in order to avoid accidental regressions. - If the new query is necessary, you should update this test, - and explain in the pull request why adding an additional query can't be avoided.""" + If an unnecessary query was removed or the new query is necessary, you should + update this test, and explain what queries we added/removed in the pull request + and why any new queries can't be avoided.""" ) def assert_json_error_contains(