Run tests under PostgreSQL (#3423)

This commit is contained in:
Amber Brown 2018-08-13 16:47:46 +10:00 committed by GitHub
parent a001038b92
commit 99dd975dae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
49 changed files with 227 additions and 59 deletions

View file

@ -147,12 +147,15 @@ class ThreadedMemoryReactorClock(MemoryReactorClock):
return d
def setup_test_homeserver(*args, **kwargs):
def setup_test_homeserver(cleanup_func, *args, **kwargs):
"""
Set up a synchronous test server, driven by the reactor used by
the homeserver.
"""
d = _sth(*args, **kwargs).result
d = _sth(cleanup_func, *args, **kwargs).result
if isinstance(d, Failure):
d.raiseException()
# Make the thread pool synchronous.
clock = d.get_clock()
@ -189,6 +192,9 @@ def setup_test_homeserver(*args, **kwargs):
def start(self):
pass
def stop(self):
pass
def callInThreadWithCallback(self, onResult, function, *args, **kwargs):
def _(res):
if isinstance(res, Failure):