Better testing error messages on protocol errors.

This commit is contained in:
L. Kärkkäinen 2020-02-28 17:26:31 +02:00
parent 6d8f5988d3
commit b2476bd7d7

View File

@ -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)