Skip to content

Commit

Permalink
Merge pull request #30 from sanic-org/move-test_mode-class-var
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins authored Dec 21, 2021
2 parents 4afe45b + 2b80ece commit f4cc666
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sanic_testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from sanic_testing.manager import TestManager

__version__ = "0.7.0"
__version__ = "0.8.0"
__all__ = ("TestManager",)
4 changes: 2 additions & 2 deletions sanic_testing/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ def __init__(
self, app: Sanic, port: typing.Optional[int] = PORT, host: str = HOST
) -> None:
"""Use port=None to bind to a random port"""
Sanic.test_mode = True
self.app = app
self.port = port
self.host = host
self.app.test_mode = True
self._do_request = _blank
app.listener("after_server_start")(self._run_request)
app.after_server_start(self._run_request)

def _run_request(self, *args, **kwargs):
return self._do_request(*args, **kwargs)
Expand Down

0 comments on commit f4cc666

Please sign in to comment.