diff --git a/sanic/testing.py b/sanic/testing.py index 09554e21..de26d025 100644 --- a/sanic/testing.py +++ b/sanic/testing.py @@ -32,7 +32,9 @@ class SanicTestClient: try: response.json = await response.json() - except (JSONDecodeError, UnicodeDecodeError): + except (JSONDecodeError, + UnicodeDecodeError, + aiohttp.ClientResponseError): response.json = None response.body = await response.read()