Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No global test_mode #61

Merged
merged 1 commit into from Dec 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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