diff options
author | Erik Johnston <erik@matrix.org> | 2016-01-28 14:45:36 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-01-28 14:45:36 +0000 |
commit | 167d1df699d64683f1f9ace759c772af1890ca56 (patch) | |
tree | a9222f66b36c828df5ca2fcd455db820dcd80dca /tests/utils.py | |
parent | Quot all the things (diff) | |
parent | Clean up a bit. Add comment (diff) | |
download | synapse-167d1df699d64683f1f9ace759c772af1890ca56.tar.xz |
Merge pull request #534 from matrix-org/erikj/setup
Add a Homeserver.setup method
Diffstat (limited to 'tests/utils.py')
-rw-r--r-- | tests/utils.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/utils.py b/tests/utils.py index d75d492cb5..43cc2b30cd 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -60,8 +60,10 @@ def setup_test_homeserver(name="test", datastore=None, config=None, **kargs): name, db_pool=db_pool, config=config, version_string="Synapse/tests", database_engine=create_engine("sqlite3"), + get_db_conn=db_pool.get_db_conn, **kargs ) + hs.setup() else: hs = HomeServer( name, db_pool=None, datastore=datastore, config=config, @@ -280,6 +282,12 @@ class SQLiteMemoryDbPool(ConnectionPool, object): lambda conn: prepare_database(conn, engine) ) + def get_db_conn(self): + conn = self.connect() + engine = create_engine("sqlite3") + prepare_database(conn, engine) + return conn + class MemoryDataStore(object): |