File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,6 +103,21 @@ uv run pytest -n auto
103103
104104Coverage is enabled by default.
105105
106+ ### Testing both sync and async engines
107+
108+ Use the ` sm_runner ` fixture (from ` tests/conftest.py ` ) when you need to test the same
109+ statechart on both sync and async engines. It is parametrized with ` ["sync", "async"] `
110+ and provides ` start() ` / ` send() ` helpers that handle engine selection automatically:
111+
112+ ``` python
113+ async def test_something (self , sm_runner ):
114+ sm = await sm_runner.start(MyStateChart)
115+ await sm_runner.send(sm, " some_event" )
116+ assert " expected_state" in sm.configuration_values
117+ ```
118+
119+ Do ** not** manually add async no-op listeners or duplicate test classes — prefer ` sm_runner ` .
120+
106121## Linting and formatting
107122
108123``` bash
You can’t perform that action at this time.
0 commit comments