@@ -25,7 +25,7 @@ provides useful fixtures and markers to make testing easier.
2525 @pytest.mark.asyncio
2626 async def test_some_asyncio_code ():
2727 res = await library.do_something()
28- assert b ' expected result' == res
28+ assert b " expected result" == res
2929
3030 pytest-asyncio has been strongly influenced by pytest-tornado _.
3131
@@ -139,9 +139,9 @@ Use ``pytest.mark.asyncio`` for this purpose.
139139.. code-block :: python
140140
141141 def test_http_client (event_loop ):
142- url = ' http://httpbin.org/get'
142+ url = " http://httpbin.org/get"
143143 resp = event_loop.run_until_complete(http_client(url))
144- assert b ' HTTP/1.1 200 OK' in resp
144+ assert b " HTTP/1.1 200 OK" in resp
145145
146146 This fixture can be easily overridden in any of the standard pytest locations
147147(e.g. directly in the test file, or in ``conftest.py ``) to use a non-default
@@ -189,12 +189,14 @@ Asynchronous fixtures are defined just like ordinary pytest fixtures, except the
189189
190190 import pytest_asyncio
191191
192+
192193 @pytest_asyncio.fixture
193194 async def async_gen_fixture():
194195 await asyncio.sleep(0.1)
195- yield 'a value'
196+ yield "a value"
197+
196198
197- @pytest_asyncio.fixture(scope=' module' )
199+ @pytest_asyncio.fixture(scope=" module" )
198200 async def async_fixture():
199201 return await asyncio.sleep(0.1)
200202
@@ -227,11 +229,13 @@ Only test coroutines will be affected (by default, coroutines prefixed by
227229.. code-block :: python
228230
229231 import asyncio
232+
230233 import pytest
231234
232235 # All test coroutines will be treated as marked.
233236 pytestmark = pytest.mark.asyncio
234237
238+
235239 async def test_example (event_loop ):
236240 """ No marker!"""
237241 await asyncio.sleep(0 , loop = event_loop)
0 commit comments