From 1e01cd54c732836b7d366d39f91d5e9ade45bb9a Mon Sep 17 00:00:00 2001 From: spencer-tb Date: Thu, 6 Aug 2026 14:49:22 +0200 Subject: [PATCH] chore(tooling): add test-docstring guidance to the write-test skill --- .claude/commands/write-test.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.claude/commands/write-test.md b/.claude/commands/write-test.md index 1cda7e433e..786fadae24 100644 --- a/.claude/commands/write-test.md +++ b/.claude/commands/write-test.md @@ -75,6 +75,13 @@ Never hand-reconstruct a gas amount by summing `fork.gas_costs()` constants (`NE - Each EIP directory has `spec.py` with `ReferenceSpec(git_path=..., version=...)` and test files declaring `REFERENCE_SPEC_GIT_PATH` / `REFERENCE_SPEC_VERSION` - Use `conftest.py` for shared fixtures within an EIP directory +## Test Docstrings + +- Keep the docstring to a short summary of the scenario and the rule it pins — a sentence or two. +- Do not narrate the implementation: parametrized cases, gas decompositions, and case-by-case outcome walkthroughs are already expressed by the code. Prose restating them goes stale when the test changes and adds review burden. +- State only what the code cannot show (e.g. why a boundary value is chosen). Prefer a short inline comment at the relevant line over growing the docstring. +- Never hardcode numeric gas values in docstrings; name the constants instead. + ## Parametrization - `@pytest.mark.parametrize("name", [pytest.param(val, id="label"), ...])` with descriptive `id=` strings