Skip to content

Commit

Permalink
Use async fixture in testing docs (#8457)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamsorcerer authored Jun 13, 2024
1 parent 40fffc0 commit db1b912
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ app test client::
body='value: {}'.format(request.app[value]).encode('utf-8'))

@pytest.fixture
def cli(loop, aiohttp_client):
async def cli(aiohttp_client):
app = web.Application()
app.router.add_get('/', previous)
app.router.add_post('/', previous)
return loop.run_until_complete(aiohttp_client(app))
return await aiohttp_client(app)

async def test_set_value(cli):
resp = await cli.post('/', data={'value': 'foo'})
Expand Down

0 comments on commit db1b912

Please sign in to comment.