streamrip/tests/util.py

18 lines
305 B
Python
Raw Permalink Normal View History

2023-10-22 09:07:17 +02: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):
items = []
2023-10-22 09:07:17 +02:00
async for item in async_gen:
items.append(item)
return items
2023-10-22 09:07:17 +02:00
return arun(_afor(async_gen))