Home / Function/ test_log_lock() — langchain Function Reference

test_log_lock() — langchain Function Reference

Architecture documentation for the test_log_lock() function in test_langchain.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  945e3aec_0b94_e3b4_90c2_bf2db1f4021c["test_log_lock()"]
  6ee6ed10_3ff3_3d50_08bc_311ea99250db["test_langchain.py"]
  945e3aec_0b94_e3b4_90c2_bf2db1f4021c -->|defined in| 6ee6ed10_3ff3_3d50_08bc_311ea99250db
  style 945e3aec_0b94_e3b4_90c2_bf2db1f4021c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/tracers/test_langchain.py lines 86–96

def test_log_lock() -> None:
    """Test that example assigned at callback start/end is honored."""
    client = unittest.mock.MagicMock(spec=Client)
    tracer = LangChainTracer(client=client)

    with unittest.mock.patch.object(tracer, "_persist_run_single", new=lambda _: _):
        run_id_1 = UUID("9d878ab3-e5ca-4218-aef6-44cbdc90160a")
        lock = threading.Lock()
        tracer.on_chain_start({"name": "example_1"}, {"input": lock}, run_id=run_id_1)
        tracer.on_chain_end({}, run_id=run_id_1)
        tracer.wait_for_futures()

Domain

Subdomains

Frequently Asked Questions

What does test_log_lock() do?
test_log_lock() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/tracers/test_langchain.py.
Where is test_log_lock() defined?
test_log_lock() is defined in libs/core/tests/unit_tests/tracers/test_langchain.py at line 86.

Analyze Your Own Codebase

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

Try Supermodel Free