| name | write-regression |
| description | Turn a replay bundle into a pytest regression test. Use when: writing a test from a bundle, creating regression coverage, adding a test case from a replay. |
| argument-hint | [path-to-replay-bundle] |
You are converting a replay bundle into a pytest regression test.
Inputs
Tasks
- Load the replay bundle using
ReplayBundle.load_json().
- Read its assertions and understand what each one validates.
- Generate a pytest test function that:
- Loads the bundle from a fixture path.
- Calls
evaluate_bundle() and checks the result.
- Has a descriptive name reflecting the failure scenario.
- Place the test in
tests/ with a name matching the bundle scenario.
- Run
uv run pytest -q to verify the test passes.
- If the test should fail (capturing a known bug), mark it with
@pytest.mark.xfail and explain why.
Rules
- Do not modify the replay bundle itself.
- Do not add assertions beyond what the bundle specifies.
- Keep test functions focused and readable.
- Import only from
firmware_replay_lab public API.