Home / File/ test_iter.py — langchain Source File

test_iter.py — langchain Source File

Architecture documentation for test_iter.py, a python file in the langchain codebase. 2 imports, 0 dependents.

File python LangChainCore Runnables 2 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  98ea6f54_398b_011c_7001_a970a01e48a9["test_iter.py"]
  f69d6389_263d_68a4_7fbf_f14c0602a9ba["pytest"]
  98ea6f54_398b_011c_7001_a970a01e48a9 --> f69d6389_263d_68a4_7fbf_f14c0602a9ba
  5ab6e71e_c4a2_1507_5383_d0705a2c240f["langchain_core.utils.iter"]
  98ea6f54_398b_011c_7001_a970a01e48a9 --> 5ab6e71e_c4a2_1507_5383_d0705a2c240f
  style 98ea6f54_398b_011c_7001_a970a01e48a9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import pytest
from langchain_core.utils.iter import batch_iterate


@pytest.mark.parametrize(
    ("input_size", "input_iterable", "expected_output"),
    [
        (2, [1, 2, 3, 4, 5], [[1, 2], [3, 4], [5]]),
        (3, [10, 20, 30, 40, 50], [[10, 20, 30], [40, 50]]),
        (1, [100, 200, 300], [[100], [200], [300]]),
        (4, [], []),
    ],
)
def test_batch_iterate(
    input_size: int,
    input_iterable: list[str],
    expected_output: list[list[str]],
) -> None:
    """Test batching function."""
    assert list(batch_iterate(input_size, input_iterable)) == expected_output

Domain

Subdomains

Dependencies

  • langchain_core.utils.iter
  • pytest

Frequently Asked Questions

What does test_iter.py do?
test_iter.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, Runnables subdomain.
What functions are defined in test_iter.py?
test_iter.py defines 1 function(s): test_batch_iterate.
What does test_iter.py depend on?
test_iter.py imports 2 module(s): langchain_core.utils.iter, pytest.
Where is test_iter.py in the architecture?
test_iter.py is located at libs/langchain/tests/unit_tests/utils/test_iter.py (domain: LangChainCore, subdomain: Runnables, directory: libs/langchain/tests/unit_tests/utils).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free