Debian Codegraph @

examples/async_step/features/steps/async_steps35.py

raw
1 # -- REQUIRES: Python >= 3.5
2 from behave import step
3 from behave.api.async_step import async_run_until_complete
4 import asyncio
5
6 @step('an async-step waits {duration:f} seconds')
7 @async_run_until_complete
8 async def step_async_step_waits_seconds_py35(context, duration):
9 """Simple example of a coroutine as async-step (in Python 3.5)"""
10 await asyncio.sleep(duration)