Skip to content

Commit

Permalink
More docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed May 24, 2017
1 parent e768779 commit e0272ab
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,16 @@ when several unused TCP ports are required in a test.
port1, port2 = unused_tcp_port_factory(), unused_tcp_port_factory()
...
``async fixtures``
Async fixtures
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.

.. code-block:: python
@pytest.fixture
async def async_gen_fixture():
yield await asyncio.sleep(0.1)
await asyncio.sleep(0.1)
yield 'a value'
@pytest.fixture(scope='module')
async def async_fixture():
Expand Down

0 comments on commit e0272ab

Please sign in to comment.