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

Show on the map →

Called by none

Calls _repo

Checks

  • assert main(["validate", "--no-git", "a.c"]) == 0

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-CONFIG-009measured
REQ-DDB-GUARD-001measured
REQ-DDB-GUARD-003measured
REQ-DDB-GUARD-004measured
REQ-DDB-GUARD-005measured
REQ-DDB-GUARD-006measured
REQ-DDB-GUARD-011measured
REQ-DDB-GUARD-012measured
REQ-DDB-GUARD-013measured
REQ-DDB-GUARD-014measured
REQ-DDB-GUARD-018measured
REQ-DDB-GUARD-020measured
REQ-DDB-GUARD-024measured
REQ-DDB-GUARD-026measured
REQ-DDB-GUARD-027measured
REQ-DDB-PIPE-011measured
REQ-DDB-SCHEMA-015measured
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
lines 35–35monkeypatch.chdir(_repo(tmp_path))lines 36–36assert main(["validate", "--no-git", "a.c"]) == 0

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

Show on the map →

Called by none

Calls _repo

Checks

  • assert main(["validate", "--no-git", "a.c"]) == 1
  • assert "doxygen-guard" in err and "clew-guard" in err, err

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measured
REQ-DDB-GUARD-013measured
REQ-DDB-GUARD-014measured
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, err

1 more lines, not shown

Activity · 5 steps
lines 50–52(_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" )lines 53–53monkeypatch.chdir(tmp_path)lines 54–54assert main(["validate", "--no-git", "a.c"]) == 1lines 55–55err = capsys.readouterr().errlines 56–56assert "doxygen-guard" in err and "clew-guard" in err, err

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

Show on the map →

Called by none

Calls _repo

Checks

  • assert main(["validate", "--no-git", "a.c"]) == 1
  • assert ".doxygen-guard.yaml" in err and ".clew.yaml" in err, err

Result: passed

Verifies

requirementlinkedpath to the implementer
REQ-DDB-GUARD-012measured
REQ-DDB-GUARD-013measured
REQ-DDB-GUARD-014measured
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

Activity · 5 steps
lines 41–41(_repo(tmp_path) / ".doxygen-guard.yaml").write_text("validate: {}\n")lines 42–42monkeypatch.chdir(tmp_path)lines 43–43assert main(["validate", "--no-git", "a.c"]) == 1lines 44–44err = capsys.readouterr().errlines 45–45assert ".doxygen-guard.yaml" in err and ".clew.yaml" in err, err