Skip to content

Commit 07ce100

Browse files
committed
[docs] Added how-to guide for testing with uvloop.
Signed-off-by: Michael Seifert <[email protected]>
1 parent 5731bd2 commit 07ce100

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

docs/source/how-to-guides/index.rst

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
=============
2+
How-To Guides
3+
=============
4+
5+
.. toctree::
6+
:hidden:
7+
8+
uvloop
9+
10+
This section of the documentation provides code snippets and recipes to accomplish specific tasks with pytest-asyncio.

docs/source/how-to-guides/uvloop.rst

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=======================
2+
How to test with uvloop
3+
=======================
4+
5+
Create the following autouse fixture in your *conftest.py:*
6+
7+
.. code-block:: python
8+
9+
import asyncio
10+
11+
import pytest
12+
import uvloop
13+
14+
15+
@pytest.fixture(scope="session", autouse=True)
16+
def event_loop_policy():
17+
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())

docs/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Welcome to pytest-asyncio!
77
:hidden:
88

99
concepts
10+
how-to-guides/index
1011
reference/index
1112
support
1213

0 commit comments

Comments
 (0)