From f39340f2d5fbf5eadcc0b4d133bcb69afe8b59d6 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:44:43 +0200 Subject: [PATCH] Fix typos --- docs/usage/testing.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/usage/testing.rst b/docs/usage/testing.rst index ccf5081448..fd507960fe 100644 --- a/docs/usage/testing.rst +++ b/docs/usage/testing.rst @@ -167,7 +167,7 @@ across requests, then you might want to inject or inspect session data outside a .. attention:: - - The Session Middleware must be enabled in Litestar app provided to the TestClient to use sessions. + - The session middleware must be enabled in the Litestar app provided to the :class:`TestClient <.testing.TestClient>` to use sessions. - If you are using the :class:`ClientSideSessionBackend ` you need to install the ``cryptography`` package. You can do so by installing ``litestar``: @@ -188,7 +188,7 @@ across requests, then you might want to inject or inspect session data outside a pipx install litestar[cryptography] - .. tab-item:: pdm + .. tab-item:: PDM .. code-block:: bash :caption: Using `PDM `_ @@ -255,7 +255,7 @@ an instance of Litestar and then a test client using it. There are multiple use generic logic that is decoupled from a specific Litestar app, or when you want to test endpoints in isolation. You can pass to this helper all the kwargs accepted by -the litestar constructor, with the ``route_handlers`` kwarg being **required**. Yet unlike the Litestar app, which +the Litestar constructor, with the ``route_handlers`` kwarg being **required**. Yet unlike the Litestar app, which expects ``route_handlers`` to be a list, here you can also pass individual values. For example, you can do this: @@ -367,7 +367,7 @@ Using polyfactory ------------------------ `Polyfactory `__ offers an easy -and powerful way to generate mock data from pydantic models and dataclasses. +and powerful way to generate mock data from Pydantic models and dataclasses. Let's say we have an API that talks to an external service and retrieves some data: @@ -427,7 +427,7 @@ We could test the ``/item`` route like so: While we can define the test data manually, as is done in the above, this can be quite cumbersome. That's where `polyfactory `_ library comes in. It generates mock data for -pydantic models and dataclasses based on type annotations. With it, we could rewrite the above example like so: +Pydantic models and dataclasses based on type annotations. With it, we could rewrite the above example like so: .. code-block:: python