Merge pull request #135 from Sharpek/master

Add loop kwargs to sanic_endpoint_test
This commit is contained in:
Channel Cat 2016-11-02 21:37:52 -07:00 committed by GitHub
commit 3d88818841

View File

@ -16,7 +16,7 @@ async def local_request(method, uri, cookies=None, *args, **kwargs):
def sanic_endpoint_test(app, method='get', uri='/', gather_request=True, def sanic_endpoint_test(app, method='get', uri='/', gather_request=True,
*request_args, **request_kwargs): loop=None, *request_args, **request_kwargs):
results = [] results = []
exceptions = [] exceptions = []
@ -34,7 +34,7 @@ def sanic_endpoint_test(app, method='get', uri='/', gather_request=True,
exceptions.append(e) exceptions.append(e)
app.stop() app.stop()
app.run(host=HOST, port=42101, after_start=_collect_response) app.run(host=HOST, port=42101, after_start=_collect_response, loop=loop)
if exceptions: if exceptions:
raise ValueError("Exception during request: {}".format(exceptions)) raise ValueError("Exception during request: {}".format(exceptions))