test_guard_hard_cut.py¶
tests/guard/test_guard_hard_cut.py
A doxygen-guard leftover fails the gate, naming it (PG4; 2.0.0, owner Q/A 2026-11-19).
test_a_clean_repo_passes
None test_guard_hard_cut.test_a_clean_repo_passes(Path tmp_path, pytest.MonkeyPatch monkeypatch)
The control: no leftover, rc 0.
tests/guard/test_guard_hard_cut.py:33
Checks
assert main(["validate", "--no-git", "a.c"]) == 0
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-CONFIG-009 | measured | |
| REQ-DDB-GUARD-001 | measured | |
| REQ-DDB-GUARD-003 | measured | |
| REQ-DDB-GUARD-004 | measured | |
| REQ-DDB-GUARD-005 | measured | |
| REQ-DDB-GUARD-006 | measured | |
| REQ-DDB-GUARD-011 | measured | |
| REQ-DDB-GUARD-012 | measured | |
| REQ-DDB-GUARD-013 | measured | |
| REQ-DDB-GUARD-014 | measured | |
| REQ-DDB-GUARD-018 | measured | |
| REQ-DDB-GUARD-020 | measured | |
| REQ-DDB-GUARD-024 | measured | |
| REQ-DDB-GUARD-026 | measured | |
| REQ-DDB-GUARD-027 | measured | |
| REQ-DDB-PIPE-011 | measured | |
| REQ-DDB-SCHEMA-015 | measured |
Source · 6 lines
def test_a_clean_repo_passes(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
"""@brief The control: no leftover, rc 0."""
monkeypatch.chdir(_repo(tmp_path))
assert main(["validate", "--no-git", "a.c"]) == 0
Activity · 2 steps
test_a_doxygen_guard_hook_id_fails_naming_it
None test_guard_hard_cut.test_a_doxygen_guard_hook_id_fails_naming_it(tmp_path, monkeypatch, capsys)
A `doxygen-guard` hook id in .pre-commit-config.yaml: rc 1, naming `clew-guard`.
tests/guard/test_guard_hard_cut.py:48
Checks
assert main(["validate", "--no-git", "a.c"]) == 1assert "doxygen-guard" in err and "clew-guard" in err, err
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | |
| REQ-DDB-GUARD-013 | measured | |
| REQ-DDB-GUARD-014 | measured |
Source · 9 lines
def test_a_doxygen_guard_hook_id_fails_naming_it(tmp_path, monkeypatch, capsys) -> None:
"""@brief A `doxygen-guard` hook id in .pre-commit-config.yaml: rc 1, naming `clew-guard`."""
(_repo(tmp_path) / ".pre-commit-config.yaml").write_text(
"repos:\n - repo: https://example.invalid/doxygen-guard\n rev: v1\n hooks:\n - id: doxygen-guard\n"
)
monkeypatch.chdir(tmp_path)
assert main(["validate", "--no-git", "a.c"]) == 1
err = capsys.readouterr().err
assert "doxygen-guard" in err and "clew-guard" in err, err1 more lines, not shown
Activity · 5 steps
test_a_leftover_doxygen_guard_yaml_fails_naming_it
None test_guard_hard_cut.test_a_leftover_doxygen_guard_yaml_fails_naming_it(tmp_path, monkeypatch, capsys)
`.doxygen-guard.yaml` present: rc 1, the file named, the fix stated.
tests/guard/test_guard_hard_cut.py:39
Checks
assert main(["validate", "--no-git", "a.c"]) == 1assert ".doxygen-guard.yaml" in err and ".clew.yaml" in err, err
Result: passed
Verifies
| requirement | linked | path to the implementer |
|---|---|---|
| REQ-DDB-GUARD-012 | measured | |
| REQ-DDB-GUARD-013 | measured | |
| REQ-DDB-GUARD-014 | measured |
Source · 9 lines
def test_a_leftover_doxygen_guard_yaml_fails_naming_it(tmp_path, monkeypatch, capsys) -> None:
"""@brief `.doxygen-guard.yaml` present: rc 1, the file named, the fix stated."""
(_repo(tmp_path) / ".doxygen-guard.yaml").write_text("validate: {}\n")
monkeypatch.chdir(tmp_path)
assert main(["validate", "--no-git", "a.c"]) == 1
err = capsys.readouterr().err
assert ".doxygen-guard.yaml" in err and ".clew.yaml" in err, err