From af3adc58480173eca3ff9c8bb25ff5e9b9d82ec8 Mon Sep 17 00:00:00 2001 From: Michael Seifert Date: Sun, 23 Jul 2023 08:27:29 +0200 Subject: [PATCH] [docs] Added how-to guide for testing with uvloop. Signed-off-by: Michael Seifert --- docs/source/how-to-guides/index.rst | 10 ++++++++++ docs/source/how-to-guides/uvloop.rst | 13 +++++++++++++ docs/source/index.rst | 1 + 3 files changed, 24 insertions(+) create mode 100644 docs/source/how-to-guides/index.rst create mode 100644 docs/source/how-to-guides/uvloop.rst diff --git a/docs/source/how-to-guides/index.rst b/docs/source/how-to-guides/index.rst new file mode 100644 index 00000000..922fac91 --- /dev/null +++ b/docs/source/how-to-guides/index.rst @@ -0,0 +1,10 @@ +============= +How-To Guides +============= + +.. toctree:: + :hidden: + + uvloop + +This section of the documentation provides code snippets and recipes to accomplish specific tasks with pytest-asyncio. diff --git a/docs/source/how-to-guides/uvloop.rst b/docs/source/how-to-guides/uvloop.rst new file mode 100644 index 00000000..14353365 --- /dev/null +++ b/docs/source/how-to-guides/uvloop.rst @@ -0,0 +1,13 @@ +======================= +How to test with uvloop +======================= + +Replace the default event loop policy in your *conftest.py:* + +.. code-block:: python + + import asyncio + + import uvloop + + asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) diff --git a/docs/source/index.rst b/docs/source/index.rst index e6b33033..a5096c56 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -7,6 +7,7 @@ Welcome to pytest-asyncio! :hidden: concepts + how-to-guides/index reference/index support