summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2017-03-23 17:53:49 +0000
committerErik Johnston <erik@matrix.org>2017-03-23 17:53:49 +0000
commit00957d1aa4b01a199ab2c3abf30032a0ca0b1e12 (patch)
tree79f6e968f784c6d4e05cda9c298d5a32fbc88291 /tests
parentMerge pull request #2005 from kfatehi/docs/readme (diff)
downloadsynapse-00957d1aa4b01a199ab2c3abf30032a0ca0b1e12.tar.xz
User Cursor.__iter__ instead of fetchall
This prevents unnecessary construction of lists
Diffstat (limited to 'tests')
-rw-r--r--tests/storage/test_base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/storage/test_base.py b/tests/storage/test_base.py
index afbefb2e2d..91e971190c 100644
--- a/tests/storage/test_base.py
+++ b/tests/storage/test_base.py
@@ -89,7 +89,7 @@ class SQLBaseStoreTestCase(unittest.TestCase):
     @defer.inlineCallbacks
     def test_select_one_1col(self):
         self.mock_txn.rowcount = 1
-        self.mock_txn.fetchall.return_value = [("Value",)]
+        self.mock_txn.__iter__ = Mock(return_value=iter([("Value",)]))
 
         value = yield self.datastore._simple_select_one_onecol(
             table="tablename",
@@ -136,7 +136,7 @@ class SQLBaseStoreTestCase(unittest.TestCase):
     @defer.inlineCallbacks
     def test_select_list(self):
         self.mock_txn.rowcount = 3
-        self.mock_txn.fetchall.return_value = ((1,), (2,), (3,))
+        self.mock_txn.__iter__ = Mock(return_value=iter([(1,), (2,), (3,)]))
         self.mock_txn.description = (
             ("colA", None, None, None, None, None, None),
         )