Navigation: reach, step, until, finish

Run to a function or line, step, run until return. Each operation returns the stop.

since 0.1.0-rc.1since 0.3.0

Methods

EntrySignatureAvailable sinceAPI 3
reachreach(location, condition=None) -> dict0.1.0-rc.1¹await in async
stepstep(count=1, *, unit="source", mode="into") -> dict0.3.0await in async
untiluntil(location=None) -> dict0.3.0await in async
finishfinish() -> dict0.3.0await in async

¹ Base form; the 0.3.0 extensions are described in the card.

API 3 changes (0.5.0)

Use await in async def. A reach condition is evaluated without calling target functions.

Recommended

The condition is an expression over data; finish returns to the calling frame.

t.reach("board_adc_sample", condition="board_adc_sequences == 3")
t.reach("app_step")
t.finish()
t.check("returned to the caller", t.frames()["frames"][0]["function"], "app_receiver_step")
t.until("app_loop")
t.step(3)

# async def
await t.reach("app_step")
await t.finish()

Avoid

A function call in a condition is refused (expression_call_forbidden). A step loop instead of reach with a condition wastes time and points.

t.reach("board_adc_sample", condition="board_adc_ready()")   # hidden call: refused
while t.read("board_adc_sequences") < 3:
    t.step()                                                     # use reach with a condition

The fragments show refused or discouraged patterns, not a working recipe.

Fragments for a scenario body; firmware symbols are illustrative.

← ScenarioAll groupsLive window →