log_outputs#

langsmith.testing._internal.log_outputs(outputs: dict, /) None[source]#

Log run outputs from within a pytest test run.

Warning

This API is in beta and might change in future versions.

Should only be used in pytest tests decorated with @pytest.mark.langsmith.

Parameters:

outputs (dict) – Outputs to log.

Return type:

None

Example

from langsmith import testing as t


@pytest.mark.langsmith
def test_foo() -> None:
    x = 0
    y = 1
    result = foo(x, y)
    t.log_outputs({"foo": result})
    assert result == 2