test_unused_var_is_refused¶
Tests › tests/test_descriptions.py
What this test is for
Why it exists
The subtle half of the template contract. A RENAMED placeholder still renders — the old var is simply ignored and the new `{brace}` stays literal — so refusing an unused var is what turns that into an error instead of prose a model reads.
Given
_redirect(monkeypatch, tmp_path)(tmp_path / "_templates").mkdir()
2 more
(tmp_path / "_templates" / "t.json").write_text( json.dumps({"text": ["hello {lead}"]}), encoding="utf-8" )_put(tmp_path, "callers", {"template": "t", "vars": {"lead": "x", "stale": "y"}})
When
d.load_descriptions()
Then
- ✓ raises ValueError
tests/test_descriptions.py:293 · its file's page
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-MCP-001 measured
- REQ-DDB-WIKI-054 inferred