diff --git a/sanic_testing/testing.py b/sanic_testing/testing.py index 26c829d..f9d08cd 100644 --- a/sanic_testing/testing.py +++ b/sanic_testing/testing.py @@ -21,7 +21,6 @@ HOST = "127.0.0.1" PORT = None -Sanic.test_mode = True httpx_version = tuple( map(int, httpx.__version__.strip(ascii_lowercase).split(".")) @@ -164,7 +163,7 @@ def _sanic_endpoint_test( gather_request: bool = True, debug: bool = False, server_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = None, - host: str = None, + host: typing.Optional[str] = None, allow_none: bool = False, *request_args, **request_kwargs, @@ -335,6 +334,7 @@ def __init__( base_url: str = ASGI_BASE_URL, suppress_exceptions: bool = False, ) -> None: + Sanic.test_mode = True app.__class__.__call__ = app_call_with_return # type: ignore app.asgi = True