mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 22:14:55 -04:00
Pass around the reactor explicitly (#3385)
This commit is contained in:
parent
c2eff937ac
commit
77ac14b960
25 changed files with 141 additions and 93 deletions
|
@ -37,11 +37,15 @@ USE_POSTGRES_FOR_TESTS = False
|
|||
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def setup_test_homeserver(name="test", datastore=None, config=None, **kargs):
|
||||
def setup_test_homeserver(name="test", datastore=None, config=None, reactor=None,
|
||||
**kargs):
|
||||
"""Setup a homeserver suitable for running tests against. Keyword arguments
|
||||
are passed to the Homeserver constructor. If no datastore is supplied a
|
||||
datastore backed by an in-memory sqlite db will be given to the HS.
|
||||
"""
|
||||
if reactor is None:
|
||||
from twisted.internet import reactor
|
||||
|
||||
if config is None:
|
||||
config = Mock()
|
||||
config.signing_key = [MockKey()]
|
||||
|
@ -110,6 +114,7 @@ def setup_test_homeserver(name="test", datastore=None, config=None, **kargs):
|
|||
database_engine=db_engine,
|
||||
room_list_handler=object(),
|
||||
tls_server_context_factory=Mock(),
|
||||
reactor=reactor,
|
||||
**kargs
|
||||
)
|
||||
db_conn = hs.get_db_conn()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue