Home / Function/ test_guard_import_failure() — langchain Function Reference

test_guard_import_failure() — langchain Function Reference

Architecture documentation for the test_guard_import_failure() function in test_utils.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  cf8755a2_446c_05fc_af37_834f7da195b4["test_guard_import_failure()"]
  76328b48_c466_d255_3e8f_a315858c4c02["test_utils.py"]
  cf8755a2_446c_05fc_af37_834f7da195b4 -->|defined in| 76328b48_c466_d255_3e8f_a315858c4c02
  style cf8755a2_446c_05fc_af37_834f7da195b4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/utils/test_utils.py lines 206–217

def test_guard_import_failure(
    module_name: str,
    pip_name: str | None,
    package: str | None,
    expected_pip_name: str,
) -> None:
    with pytest.raises(
        ImportError,
        match=f"Could not import {module_name} python package. "
        f"Please install it with `pip install {expected_pip_name}`.",
    ):
        guard_import(module_name, pip_name=pip_name, package=package)

Domain

Subdomains

Frequently Asked Questions

What does test_guard_import_failure() do?
test_guard_import_failure() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/utils/test_utils.py.
Where is test_guard_import_failure() defined?
test_guard_import_failure() is defined in libs/core/tests/unit_tests/utils/test_utils.py at line 206.

Analyze Your Own Codebase

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

Try Supermodel Free