summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-06-22 09:37:10 +0100
committerGitHub <noreply@github.com>2018-06-22 09:37:10 +0100
commit77ac14b960cb8daef76062ce85fc0427749b48af (patch)
tree4a2b3af0e0404640a2ef251030cd3c2591a1d6ba /tests/utils.py
parentPopulate synapse_federation_client_sent_pdu_destinations:count again (#3386) (diff)
downloadsynapse-77ac14b960cb8daef76062ce85fc0427749b48af.tar.xz
Pass around the reactor explicitly (#3385)
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 262c4a5714..189fd2711c 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -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()