Skip to content

Commit bf8b200

Browse files
tests: drop redundant Protocol assertion
The ``_: ProjectionStrategy[S, Inner] = BoomProjection()`` line was a defensive belt-and-suspenders structural-conformance check, but the call-site ``add_subgraph_node(projection=BoomProjection())`` exercises the same Protocol check via its parameter annotation — pyright catches a mismatch there without needing the explicit assignment. Drop the line and update the comment to point at the call site.
1 parent 3866f81 commit bf8b200

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tests/unit/test_runtime_errors.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def test_subgraph_projection_error_wrapped_as_node_exception() -> None:
105105
NodeException tagged with the subgraph wrapper's name so callers see
106106
a uniform error contract."""
107107

108-
from openarmature.graph import NodeException, ProjectionStrategy
108+
from openarmature.graph import NodeException
109109

110110
class Inner(State):
111111
x: int = 0
@@ -115,8 +115,9 @@ async def _inner_node(_s: Inner) -> dict[str, Any]:
115115

116116
inner_g = GraphBuilder(Inner).add_node("i", _inner_node).add_edge("i", END).set_entry("i").compile()
117117

118-
# Parameter names match the ProjectionStrategy Protocol exactly so
119-
# pyright's strict structural conformance check passes.
118+
# Parameter names match the ProjectionStrategy Protocol exactly so the
119+
# call-site ``projection=BoomProjection()`` below passes pyright's strict
120+
# structural conformance check.
120121
class BoomProjection:
121122
def project_in(self, parent_state: S, subgraph_state_cls: type[Inner]) -> Inner:
122123
raise RuntimeError("project_in boom")
@@ -129,8 +130,6 @@ def project_out(
129130
) -> dict[str, Any]:
130131
return {}
131132

132-
_: ProjectionStrategy[S, Inner] = BoomProjection()
133-
134133
g = (
135134
GraphBuilder(S)
136135
.add_subgraph_node("sub", inner_g, projection=BoomProjection())

0 commit comments

Comments
 (0)