examples/async_step/features/steps/async_steps34.py
raw| 1 | # -- REQUIRES: Python >= 3.4 |
| 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 | @asyncio.coroutine |
| 9 | def step_async_step_waits_seconds_py34(context, duration): |
| 10 | yield from asyncio.sleep(duration) |