# Path: tests/fixtures.py
# @pytest.fixture
# def client():
#     yield Elasticsearch()
# 
# @pytest.fixture
# def cluster(client):
#     yield Cluster(
#         client, autodetect_es_version=False, compiler=Compiler_5_0
#     )
# 
# @pytest.fixture(params=all_compilers)
# def compiler(request):
#     return request.param
# 
# @pytest.fixture
# def index(cluster):
#     yield Index(cluster, 'test')


from .fixtures import client, cluster, compiler, index  # noqa: F401


def assert_expression(expr, expected, compiler):  # noqa: F811
    assert expr.to_dict(compiler=compiler) == expected


def assert_same_elements(seq1, seq2):
    it1 = iter(seq1)
    it2 = iter(seq2)
    i = 0
    while True:
        try:
            e1 = next(it1)
        except StopIteration:
            try:
                e2 = next(it2)
            except StopIteration:
                break
            else:
                raise AssertionError(
                    'seq2 has more elements than seq1: {!r}'.format(e2)
                )
        try:
            e2 = next(it2)

# Path: tests/fixtures.py
# @pytest.fixture
# def client():
#     yield Elasticsearch()
# 
# @pytest.fixture
# def cluster(client):
#     yield Cluster(
#         client, autodetect_es_version=False, compiler=Compiler_5_0
#     )
# 
# @pytest.fixture(params=all_compilers)
# def compiler(request):
#     return request.param
# 
# @pytest.fixture
# def index(cluster):
#     yield Index(cluster, 'test')


# Path: tests/conftest.py
from .fixtures import client, cluster, compiler, index  # noqa: F401



def assert_expression(expr, expected, compiler):  # noqa: F811
    assert expr.to_dict(compiler=compiler) == expected


def assert_same_elements(seq1, seq2):
    it1 = iter(seq1)
    it2 = iter(seq2)
    i = 0
    while True:
        try:
            e1 = next(it1)
        except StopIteration:
            try:
                e2 = next(it2)
            except StopIteration:
                break
            else:
                raise AssertionError(
                    'seq2 has more elements than seq1: {!r}'.format(e2)
                )
        try:
            e2 = next(it2)

        except StopIteration: