<commit_before>import pytest

from aioelasticsearch.helpers import Scan
from tests.utils import populate


@pytest.mark.parametrize('n,scroll_size', [
    (0, 1),  # no results
    (6, 6),  # 1 scroll
    (6, 8),  # 1 scroll
    (6, 3),  # 2 scrolls
    (6, 4),  # 2 scrolls
    (6, 2),  # 3 scrolls
    (6, 1),  # 6 scrolls
])
@pytest.mark.run_loop
async def test_scan_equal_chunks_for_loop(loop, es, n, scroll_size):
    index = 'test_aioes'
    doc_type = 'type_1'
    await populate(es, index, doc_type, n, loop=loop)

    ids = set()
    data = []
    async with Scan(
        es,
        index=index,
        doc_type=doc_type,
        size=scroll_size,
        loop=loop,
    ) as scan:

        async for scroll in scan:<commit_msg>skip flake8 for 3.5 async tests<commit_after>import pytest

from aioelasticsearch.helpers import Scan
from tests.utils import populate


@pytest.mark.parametrize('n,scroll_size', [
    (0, 1),  # no results
    (6, 6),  # 1 scroll
    (6, 8),  # 1 scroll
    (6, 3),  # 2 scrolls
    (6, 4),  # 2 scrolls
    (6, 2),  # 3 scrolls
    (6, 1),  # 6 scrolls
])
@pytest.mark.run_loop
async def test_scan_equal_chunks_for_loop(loop, es, n, scroll_size):  # noqa
    index = 'test_aioes'
    doc_type = 'type_1'
    await populate(es, index, doc_type, n, loop=loop)

    ids = set()
    data = []
    async with Scan(
        es,
        index=index,
        doc_type=doc_type,
        size=scroll_size,
        loop=loop,
    ) as scan:

        async for scroll in scan:
{'fraction_non_alphanumeric': 0.12350597609561753, 'fraction_numerical': 0.029880478087649404, 'mean_word_length': 2.5046511627906978, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7426116', 'n_tokens_mistral': 601, 'n_tokens_neox': 571, 'n_words': 153}