diff --git a/sanic/testing.py b/sanic/testing.py index f4b297da..cb110cd3 100644 --- a/sanic/testing.py +++ b/sanic/testing.py @@ -40,6 +40,9 @@ class SanicTestClient: response = await getattr(session, method.lower())( url, verify=False, *args, **kwargs ) + except httpx.exceptions.ConnectionClosed: + logger.error(f"{method.upper()} {url} broken HTTP, response is None!") + return None except NameError: raise Exception(response.status_code)