Clean-up some broken/unused code in the test framework (#8514)
parent
9789b1fba5
commit
d35a451399
|
@ -0,0 +1 @@
|
|||
Remove unused code from the test framework.
|
|
@ -367,8 +367,6 @@ def setup_test_homeserver(cleanup_func, *args, **kwargs):
|
|||
"""
|
||||
server = _sth(cleanup_func, *args, **kwargs)
|
||||
|
||||
database = server.config.database.get_single_database()
|
||||
|
||||
# Make the thread pool synchronous.
|
||||
clock = server.get_clock()
|
||||
|
||||
|
|
|
@ -192,7 +192,6 @@ class TestHomeServer(HomeServer):
|
|||
def setup_test_homeserver(
|
||||
cleanup_func,
|
||||
name="test",
|
||||
datastore=None,
|
||||
config=None,
|
||||
reactor=None,
|
||||
homeserverToUse=TestHomeServer,
|
||||
|
@ -249,7 +248,7 @@ def setup_test_homeserver(
|
|||
|
||||
# Create the database before we actually try and connect to it, based off
|
||||
# the template database we generate in setupdb()
|
||||
if datastore is None and isinstance(db_engine, PostgresEngine):
|
||||
if isinstance(db_engine, PostgresEngine):
|
||||
db_conn = db_engine.module.connect(
|
||||
database=POSTGRES_BASE_DB,
|
||||
user=POSTGRES_USER,
|
||||
|
@ -265,7 +264,6 @@ def setup_test_homeserver(
|
|||
cur.close()
|
||||
db_conn.close()
|
||||
|
||||
if datastore is None:
|
||||
hs = homeserverToUse(
|
||||
name,
|
||||
config=config,
|
||||
|
@ -327,18 +325,6 @@ def setup_test_homeserver(
|
|||
# Register the cleanup hook
|
||||
cleanup_func(cleanup)
|
||||
|
||||
else:
|
||||
hs = homeserverToUse(
|
||||
name,
|
||||
datastore=datastore,
|
||||
config=config,
|
||||
version_string="Synapse/tests",
|
||||
tls_server_context_factory=Mock(),
|
||||
tls_client_options_factory=Mock(),
|
||||
reactor=reactor,
|
||||
**kargs
|
||||
)
|
||||
|
||||
# bcrypt is far too slow to be doing in unit tests
|
||||
# Need to let the HS build an auth handler and then mess with it
|
||||
# because AuthHandler's constructor requires the HS, so we can't make one
|
||||
|
|
Loading…
Reference in New Issue