From 2aa757988425cf1b917643857f264163a4bde4d2 Mon Sep 17 00:00:00 2001 From: Hyunjun Kim Date: Wed, 11 Jan 2017 17:22:40 +0900 Subject: [PATCH] Using signal to collect reqeust in endpoint test --- sanic/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sanic/utils.py b/sanic/utils.py index 1eaa0493..e4b3b69f 100644 --- a/sanic/utils.py +++ b/sanic/utils.py @@ -1,5 +1,6 @@ import aiohttp from sanic.log import log +from sanic.signals import request_started HOST = '127.0.0.1' PORT = 42101 @@ -24,7 +25,7 @@ def sanic_endpoint_test(app, method='get', uri='/', gather_request=True, if gather_request: def _collect_request(request): results.append(request) - app.request_middleware.appendleft(_collect_request) + request_started.connect(_collect_request) async def _collect_response(sanic, loop): try: