squash this

This commit is contained in:
Adam Hopkins
2020-07-13 23:59:45 +03:00
parent 050a563e1d
commit cf234fca15
5 changed files with 61 additions and 81 deletions

View File

@@ -62,6 +62,20 @@ Additionally, Sanic has an asynchronous testing client. The difference is that t
instance of your application, but will instead reach inside it using ASGI. All listeners and middleware are still
executed.
.. code-block:: python
@pytest.mark.asyncio
async def test_index_returns_200():
request, response = await app.asgi_client.put('/')
assert response.status == 200
.. note::
Whenever one of the test clients run, you can test your app instance to determine if it is in testing mode:
`app.test_mode`.
Additionally, Sanic has an asynchronous testing client. The difference is that the async client will not stand up an
instance of your application, but will instead reach inside it using ASGI. All listeners and middleware are still
executed.
.. code-block:: python
@pytest.mark.asyncio