streamrip/tests/fixtures/util.py

18 lines
302 B
Python
Raw Normal View History

2023-10-29 17:42:10 -04:00
import asyncio
loop = asyncio.new_event_loop()
def arun(coro):
return loop.run_until_complete(coro)
def afor(async_gen):
async def _afor(async_gen):
item = []
2023-10-29 17:42:10 -04:00
async for item in async_gen:
item.append(item)
return item
2023-10-29 17:42:10 -04:00
return arun(_afor(async_gen))