# Path: graphscale/utils.py
# async def async_list(coros: List[Awaitable[T]]) -> List[T]:
#     """Use to await a list and return a list.
#     Example: list_of_results = await async_list(list_of_gens)
#     """
#     return await asyncio.gather(*coros)


import asyncio
import pytest
from typing import List
from aiodataloader import DataLoader
from graphscale.utils import async_list
    async def _batch_load_fn(self, keys: List[int]) -> List[str]:
        self.calls.append(keys)
        return [str(key) for key in keys]


async def test_aiodataloader_singleload() -> None:
    loader = StringLoader()
    promise1 = loader.load(1)

    value1 = await promise1
    assert value1 == '1'
    assert loader.calls == [[1]]


async def test_aiodataloder_manyload() -> None:
    loader = StringLoader()
    values = await loader.load_many([1, 2])
    assert values == ['1', '2']
    assert loader.calls == [[1, 2]]


async def test_aiodataloader_loadparallel() -> None:
    loader = StringLoader()
    values = await asyncio.gather(loader.load(1), loader.load(2))
    assert values == ['1', '2']
    assert loader.calls == [[1, 2]]


async def test_aiodataloader_asynclist() -> None:
    loader = StringLoader()

# Path: graphscale/utils.py
# async def async_list(coros: List[Awaitable[T]]) -> List[T]:
#     """Use to await a list and return a list.
#     Example: list_of_results = await async_list(list_of_gens)
#     """
#     return await asyncio.gather(*coros)


# Path: tests/test_aiodataloader.py
import asyncio
import pytest
from typing import List
from aiodataloader import DataLoader
from graphscale.utils import async_list

    async def _batch_load_fn(self, keys: List[int]) -> List[str]:
        self.calls.append(keys)
        return [str(key) for key in keys]


async def test_aiodataloader_singleload() -> None:
    loader = StringLoader()
    promise1 = loader.load(1)

    value1 = await promise1
    assert value1 == '1'
    assert loader.calls == [[1]]


async def test_aiodataloder_manyload() -> None:
    loader = StringLoader()
    values = await loader.load_many([1, 2])
    assert values == ['1', '2']
    assert loader.calls == [[1, 2]]


async def test_aiodataloader_loadparallel() -> None:
    loader = StringLoader()
    values = await asyncio.gather(loader.load(1), loader.load(2))
    assert values == ['1', '2']
    assert loader.calls == [[1, 2]]


async def test_aiodataloader_asynclist() -> None:
    loader = StringLoader()

    values = await async_list([loader.load(1), loader.load(2)])