From 9fac37588c4f15446397638c72efc79bfcf0d636 Mon Sep 17 00:00:00 2001 From: Nikola Kolevski Date: Tue, 20 Jun 2017 13:15:30 +0200 Subject: [PATCH] Allow textual responses when using test_client and aiohttp 2 --- sanic/testing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/testing.py b/sanic/testing.py index 09554e21..075185b7 100644 --- a/sanic/testing.py +++ b/sanic/testing.py @@ -32,7 +32,7 @@ class SanicTestClient: try: response.json = await response.json() - except (JSONDecodeError, UnicodeDecodeError): + except (JSONDecodeError, UnicodeDecodeError, aiohttp.ClientResponseError): response.json = None response.body = await response.read()