We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e768779 commit e0272abCopy full SHA for e0272ab
README.rst
@@ -110,15 +110,16 @@ when several unused TCP ports are required in a test.
110
port1, port2 = unused_tcp_port_factory(), unused_tcp_port_factory()
111
...
112
113
-``async fixtures``
+Async fixtures
114
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115
-Asynchronous fixtures are defined similar to ordinary pytest fixtures.
+Asynchronous fixtures are defined just like ordinary pytest fixtures, except they should be coroutines or asynchronous generators.
116
117
.. code-block:: python
118
119
@pytest.fixture
120
async def async_gen_fixture():
121
- yield await asyncio.sleep(0.1)
+ await asyncio.sleep(0.1)
122
+ yield 'a value'
123
124
@pytest.fixture(scope='module')
125
async def async_fixture():
0 commit comments