# Path: tests_integ/asyncio/conftest.py
# def event_loop(request):
# async def es_client(event_loop, es_url):
# def es_cluster(es_client):
# async def es_index(es_cluster, es_client, index_name):
# async def cars(es_index, car_docs):
# async def all_cars(es_index, all_car_docs):


import pytest
from .conftest import Car
    with pytest.raises(ValueError):
        await sq[:-1]

    with pytest.raises(ValueError):
        await sq[::2]

    docs = await sq[1:2]
    assert len(docs) == 1

    docs = await sq[:2]
    assert len(docs) == 2

    doc = await sq[0]
    assert doc is not None


@pytest.mark.asyncio
async def test_scroll(es_index, all_cars):
    assert await es_index.search_query().count() == 11

    sq = es_index.search_query(scroll='1m', doc_cls=Car).limit(5)

    res = await sq.get_result()
    assert len(res.hits) == 5

    res = await es_index.scroll(
        scroll_id=res.scroll_id, scroll='1m', doc_cls=Car
    )
    assert len(res.hits) == 5


# Path: tests_integ/asyncio/conftest.py
# def event_loop(request):
# async def es_client(event_loop, es_url):
# def es_cluster(es_client):
# async def es_index(es_cluster, es_client, index_name):
# async def cars(es_index, car_docs):
# async def all_cars(es_index, all_car_docs):


# Path: tests_integ/asyncio/test_search.py
import pytest
from .conftest import Car

    with pytest.raises(ValueError):
        await sq[:-1]

    with pytest.raises(ValueError):
        await sq[::2]

    docs = await sq[1:2]
    assert len(docs) == 1

    docs = await sq[:2]
    assert len(docs) == 2

    doc = await sq[0]
    assert doc is not None


@pytest.mark.asyncio
async def test_scroll(es_index, all_cars):
    assert await es_index.search_query().count() == 11

    sq = es_index.search_query(scroll='1m', doc_cls=Car).limit(5)

    res = await sq.get_result()
    assert len(res.hits) == 5

    res = await es_index.scroll(
        scroll_id=res.scroll_id, scroll='1m', doc_cls=Car
    )
    assert len(res.hits) == 5


    res = await es_index.scroll(