Skip to content

Commit 81046e8

Browse files
tests: comment LLM step sentinel + parametrize list factories
- Annotate ``step=-1`` in the synthetic LLM-event observer test to point readers at ``OpenAIProvider._llm_event`` (openai.py:643) where the same sentinel is minted for production LLM-provider span events that aren't tied to graph step sequencing. - ``_ParentState`` in the fan-out gating test now uses ``Field(default_factory=list[int])`` instead of the bare ``[]`` default, matching the parametrized factory shape used in ``test_checkpoint.py``'s ``_ParentState`` and the surrounding pyright-strict expectation that field types are fully known.
1 parent bf8b200 commit 81046e8

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

tests/unit/test_observability_otel.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import logging
2525

2626
import pytest
27+
from pydantic import Field
2728

2829
# Skip the entire module if otel extras aren't installed.
2930
pytest.importorskip("opentelemetry.sdk.trace")
@@ -271,6 +272,9 @@ async def test_disable_llm_spans_skips_llm_provider_span() -> None:
271272
span_processor=SimpleSpanProcessor(exporter),
272273
disable_llm_spans=True,
273274
)
275+
# ``step=-1`` mirrors the synthetic value ``OpenAIProvider._llm_event``
276+
# mints (openai.py:643) — LLM-provider events aren't tied to graph step
277+
# sequencing.
274278
started = NodeEvent(
275279
node_name="openarmature.llm.complete",
276280
namespace=("openarmature.llm.complete",),
@@ -556,8 +560,8 @@ async def test_concurrent_fan_out_no_lifo_violation() -> None:
556560
import warnings
557561

558562
class _ParentState(State):
559-
items: list[int] = []
560-
results: list[int] = []
563+
items: list[int] = Field(default_factory=list[int])
564+
results: list[int] = Field(default_factory=list[int])
561565

562566
class _ChildState(State):
563567
item: int = 0

0 commit comments

Comments
 (0)