summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-03-24 11:40:08 +0000
committerGitHub <noreply@github.com>2017-03-24 11:40:08 +0000
commit57cfa513f5ff939d88ebb3a213d977517395a631 (patch)
tree6e658aa7007fd8f890a631c5ea8c654b721d375d /tests
parentMerge pull request #2055 from matrix-org/dbkr/fix_add_msisdn_requestToken (diff)
parentReplace some calls to cursor_to_dict (diff)
downloadsynapse-57cfa513f5ff939d88ebb3a213d977517395a631.tar.xz
Merge pull request #2054 from matrix-org/erikj/user_iter_cursor
Reduce some CPU work on DB threads
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),
         )