log_reference_outputs#

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

Log example reference 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) – Reference outputs to log.

Return type:

None

Example

from langsmith import testing


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