tests: Flush per-request caches automatically for query counts.

This commit is contained in:
Steve Howell
2023-08-11 14:40:06 +00:00
committed by Tim Abbott
parent 730ae61ce5
commit 751b8b5bb5
9 changed files with 15 additions and 33 deletions

View File

@@ -56,6 +56,7 @@ from zerver.models import (
Subscription,
UserMessage,
UserProfile,
flush_per_request_caches,
get_client,
get_realm,
get_stream,
@@ -181,6 +182,7 @@ def queries_captured(
if not keep_cache_warm:
cache = get_cache_backend(None)
cache.clear()
flush_per_request_caches()
with mock.patch.multiple(
TimeTrackingCursor, execute=cursor_execute, executemany=cursor_executemany
):