mirror of
https://github.com/zulip/zulip.git
synced 2025-11-21 23:19:10 +00:00
test_helpers: Convert TypedDict from queries_captured to dataclass.
An implicit coercion from an untyped dict to the TypedDict was hiding
a type error: CapturedQuery.sql was really str, not bytes. We should
always prefer dataclass over TypedDict to prevent such errors.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit 92db6eba78)
This commit is contained in:
committed by
Alex Vandiver
parent
9628cc9278
commit
201cab601a
@@ -1189,7 +1189,7 @@ Output:
|
||||
if actual_count != count: # nocoverage
|
||||
print("\nITEMS:\n")
|
||||
for index, query in enumerate(queries):
|
||||
print(f"#{index + 1}\nsql: {str(query['sql'])}\ntime: {query['time']}\n")
|
||||
print(f"#{index + 1}\nsql: {str(query.sql)}\ntime: {query.time}\n")
|
||||
print(f"expected count: {count}\nactual count: {actual_count}")
|
||||
raise AssertionError(
|
||||
f"""
|
||||
|
||||
Reference in New Issue
Block a user