We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc408b5 commit ad036adCopy full SHA for ad036ad
tests/testapp/utils.py
@@ -1,9 +1,11 @@
1
from __future__ import annotations
2
3
from contextlib import contextmanager
4
+from typing import Any
5
6
import pytest
7
from django.db import DEFAULT_DB_ALIAS, connection, connections
8
+from django.db.backends.utils import CursorWrapper
9
from django.test.utils import CaptureQueriesContext
10
11
@@ -72,6 +74,6 @@ def used_indexes(query, using=DEFAULT_DB_ALIAS):
72
74
return {row["key"] for row in fetchall_dicts(cursor) if row["key"] is not None}
73
75
76
-def fetchall_dicts(cursor):
77
+def fetchall_dicts(cursor: CursorWrapper) -> list[dict[str, Any]]:
78
columns = [x[0] for x in cursor.description]
79
return [dict(zip(columns, row)) for row in cursor.fetchall()]
0 commit comments