Home / Function/ test_tracing_context() — langchain Function Reference

test_tracing_context() — langchain Function Reference

Architecture documentation for the test_tracing_context() function in test_tracing_interops.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  90965a7b_84e1_a510_b127_904a40edb3f9["test_tracing_context()"]
  0944f1ae_0eea_e3a0_544b_8617adb53dbc["test_tracing_interops.py"]
  90965a7b_84e1_a510_b127_904a40edb3f9 -->|defined in| 0944f1ae_0eea_e3a0_544b_8617adb53dbc
  8c16b015_8380_d9f6_e698_f4a12f12a4f5["_get_posts()"]
  90965a7b_84e1_a510_b127_904a40edb3f9 -->|calls| 8c16b015_8380_d9f6_e698_f4a12f12a4f5
  style 90965a7b_84e1_a510_b127_904a40edb3f9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/tests/unit_tests/runnables/test_tracing_interops.py lines 54–75

def test_tracing_context() -> None:
    mock_session = MagicMock()
    mock_client_ = Client(
        session=mock_session, api_key="test", auto_batch_tracing=False
    )

    @RunnableLambda
    def my_lambda(a: int) -> int:
        return a + 1

    @RunnableLambda
    def my_function(a: int) -> int:
        with tracing_context(enabled=False):
            return my_lambda.invoke(a)

    name = uuid.uuid4().hex
    project_name = f"Some project {name}"
    with tracing_context(project_name=project_name, client=mock_client_, enabled=True):
        assert my_function.invoke(1) == 2
    posts = _get_posts(mock_client_)
    assert len(posts) == 1
    assert all(post["session_name"] == project_name for post in posts)

Domain

Subdomains

Calls

Frequently Asked Questions

What does test_tracing_context() do?
test_tracing_context() is a function in the langchain codebase, defined in libs/core/tests/unit_tests/runnables/test_tracing_interops.py.
Where is test_tracing_context() defined?
test_tracing_context() is defined in libs/core/tests/unit_tests/runnables/test_tracing_interops.py at line 54.
What does test_tracing_context() call?
test_tracing_context() calls 1 function(s): _get_posts.

Analyze Your Own Codebase

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

Try Supermodel Free