summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-11-16 00:12:59 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2021-11-17 00:47:56 +0000
commit88c69998402a9d1416b822c92ab8b5e08698595d (patch)
treef810def0c86cc261544eee64e0f6d89fe137b79d
parentIgnore monkey-patching functions. mypy doesn't currently allow this. (diff)
downloadsynapse-88c69998402a9d1416b822c92ab8b5e08698595d.tar.xz
Pass a fake Connection mock to SQLBaseStore, instead of None.
SQLBaseStore expects the connection to be non-Optional, so we can't just pass none.

Note that this parameter isn't even used by the function anyhow. I believe it's only there to satisfy the inherited class it's overriding.
-rw-r--r--tests/storage/test_base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/storage/test_base.py b/tests/storage/test_base.py

index b36fa66f00..e96037ac8a 100644 --- a/tests/storage/test_base.py +++ b/tests/storage/test_base.py
@@ -22,6 +22,7 @@ from synapse.config.homeserver import HomeServerConfig from synapse.storage._base import SQLBaseStore from synapse.storage.database import DatabasePool from synapse.storage.engines import create_engine +from synapse.storage.types import Connection from tests import unittest from tests.utils import TestHomeServer, default_config @@ -63,7 +64,7 @@ class SQLBaseStoreTestCase(unittest.TestCase): db = DatabasePool(Mock(), Mock(config=sqlite_config), fake_engine) db._db_pool = self.db_pool - self.datastore = SQLBaseStore(db, None, hs) + self.datastore = SQLBaseStore(db, Mock(spec=Connection), hs) @defer.inlineCallbacks def test_insert_1col(self):