Skip to content

Commit

Permalink
No global test_mode (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Dec 27, 2022
1 parent 3967c76 commit b735cb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sanic_testing/testing.py
Expand Up @@ -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("."))
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b735cb2

Please sign in to comment.