diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2023-10-26 13:01:36 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-26 13:01:36 -0400 |
commit | 9407d5ba78d1e5275b5817ae9e6aedf7d1ca14f7 (patch) | |
tree | 70935c19b787e89115d6f8884f3d134a6bacf264 /tests/storage/test_base.py | |
parent | Pin the recommended poetry version in contributors' guide (#16550) (diff) | |
download | synapse-9407d5ba78d1e5275b5817ae9e6aedf7d1ca14f7.tar.xz |
Convert simple_select_list and simple_select_list_txn to return lists of tuples (#16505)
This should use fewer allocations and improves type hints.
Diffstat (limited to 'tests/storage/test_base.py')
-rw-r--r-- | tests/storage/test_base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/storage/test_base.py b/tests/storage/test_base.py index 256d28e4c9..e4a52c301e 100644 --- a/tests/storage/test_base.py +++ b/tests/storage/test_base.py @@ -146,7 +146,7 @@ class SQLBaseStoreTestCase(unittest.TestCase): @defer.inlineCallbacks def test_select_list(self) -> Generator["defer.Deferred[object]", object, None]: self.mock_txn.rowcount = 3 - self.mock_txn.__iter__ = Mock(return_value=iter([(1,), (2,), (3,)])) + self.mock_txn.fetchall.return_value = [(1,), (2,), (3,)] self.mock_txn.description = (("colA", None, None, None, None, None, None),) ret = yield defer.ensureDeferred( @@ -155,7 +155,7 @@ class SQLBaseStoreTestCase(unittest.TestCase): ) ) - self.assertEqual([{"colA": 1}, {"colA": 2}, {"colA": 3}], ret) + self.assertEqual([(1,), (2,), (3,)], ret) self.mock_txn.execute.assert_called_with( "SELECT colA FROM tablename WHERE keycol = ?", ["A set"] ) |