Fix postgres unit tests to use prepare_database

pull/6231/head
Erik Johnston 2019-10-22 11:02:01 +01:00
parent bb6264be0b
commit 336eeea3ff
1 changed files with 2 additions and 10 deletions

View File

@ -38,11 +38,7 @@ from synapse.logging.context import LoggingContext
from synapse.server import HomeServer from synapse.server import HomeServer
from synapse.storage import DataStore from synapse.storage import DataStore
from synapse.storage.engines import PostgresEngine, create_engine from synapse.storage.engines import PostgresEngine, create_engine
from synapse.storage.prepare_database import ( from synapse.storage.prepare_database import prepare_database
_get_or_create_schema_state,
_setup_new_database,
prepare_database,
)
from synapse.util.ratelimitutils import FederationRateLimiter from synapse.util.ratelimitutils import FederationRateLimiter
# set this to True to run the tests against postgres instead of sqlite. # set this to True to run the tests against postgres instead of sqlite.
@ -88,11 +84,7 @@ def setupdb():
host=POSTGRES_HOST, host=POSTGRES_HOST,
password=POSTGRES_PASSWORD, password=POSTGRES_PASSWORD,
) )
cur = db_conn.cursor() prepare_database(db_conn, db_engine, None)
_get_or_create_schema_state(cur, db_engine)
_setup_new_database(cur, db_engine)
db_conn.commit()
cur.close()
db_conn.close() db_conn.close()
def _cleanup(): def _cleanup():