diff --git a/scripts/eval/_ast_equiv.py b/scripts/eval/_ast_equiv.py index 893efd2..6199c73 100644 --- a/scripts/eval/_ast_equiv.py +++ b/scripts/eval/_ast_equiv.py @@ -100,7 +100,7 @@ def _has_tree_sitter() -> bool: path independently of the host environment. """ try: - import tree_sitter # type: ignore[import-not-found] # noqa: F401 + import tree_sitter # noqa: F401 return True except ImportError: diff --git a/tests/eval/unit/test_r2_meta.py b/tests/eval/unit/test_r2_meta.py index f66aa1d..524f6cd 100644 --- a/tests/eval/unit/test_r2_meta.py +++ b/tests/eval/unit/test_r2_meta.py @@ -13,6 +13,7 @@ import pytest import yaml from pydantic import ValidationError +from pytest_mock import MockerFixture from scripts.eval._schemas import SampleMeta @@ -60,7 +61,7 @@ def test_TB_U_07_tier_below_range_rejected() -> None: assert "greater_than_equal" in str(exc.value) or ">=" in str(exc.value) -def test_TB_U_04_from_merge_ref_derivation(mocker) -> None: +def test_TB_U_04_from_merge_ref_derivation(mocker: MockerFixture) -> None: """Mock subprocess.run to verify the 4-ref derivation rule: base = git merge-base ^1 ^2 @@ -71,7 +72,9 @@ def test_TB_U_04_from_merge_ref_derivation(mocker) -> None: (sample_import.py:11-21 docstring contract; locks v1 [plan] §C1) """ - def fake_git_run(cmd, **kwargs): + def fake_git_run( + cmd: list[str] | str, **kwargs: object + ) -> subprocess.CompletedProcess[str]: args = cmd if isinstance(cmd, list) else cmd.split() verb_idx = next(i for i, a in enumerate(args) if a == "git") + 3 verb = args[verb_idx] diff --git a/tests/eval/unit/test_r2_sha_lock.py b/tests/eval/unit/test_r2_sha_lock.py index ac38cc0..43cdec9 100644 --- a/tests/eval/unit/test_r2_sha_lock.py +++ b/tests/eval/unit/test_r2_sha_lock.py @@ -11,10 +11,12 @@ import json from pathlib import Path +import pytest + from tests.eval.manifests import _r2_sha -def test_TB_U_05_lock_round_trip_matches_disk(tmp_path) -> None: +def test_TB_U_05_lock_round_trip_matches_disk(tmp_path: Path) -> None: """Build lock entries, write them, then re-verify — must report match.""" # use real on-disk samples; manifest may live in tmp_path so we don't # disturb the committed lock. @@ -30,7 +32,9 @@ def test_TB_U_05_lock_round_trip_matches_disk(tmp_path) -> None: assert rc_verify == 0 -def test_TB_U_08_tampered_sample_reports_mismatch(tmp_path, capsys) -> None: +def test_TB_U_08_tampered_sample_reports_mismatch( + tmp_path: Path, capsys: pytest.CaptureFixture[str] +) -> None: """Copy r2-0001 to tmp, tamper meta.yaml, lock then alter — verify fails.""" repo_root = Path(__file__).resolve().parents[3] src = repo_root / "tests" / "eval" / "datasets" / "r2" / "samples" diff --git a/tests/unit/test_cleanup_residue.py b/tests/unit/test_cleanup_residue.py index 94be127..fde0fd0 100644 --- a/tests/unit/test_cleanup_residue.py +++ b/tests/unit/test_cleanup_residue.py @@ -78,7 +78,7 @@ def test_docs_no_no_tui_except_deprecation_note() -> None: Scanned: CLAUDE.md, README*.md, doc/*.md (recursive). Excluded: - - doc/web-ui-redesign-handoff.md — frozen historical record + - doc/modules/web-ui-redesign-handoff.md — frozen historical record - doc/test-report/** — historical test reports - docs/web-ui-redesign-tests.md — test matrix references --no-tui for historical context (location pointer for the cleanup) @@ -90,7 +90,7 @@ def test_docs_no_no_tui_except_deprecation_note() -> None: candidates.append(path) excluded_paths = { - REPO_ROOT / "doc" / "web-ui-redesign-handoff.md", + REPO_ROOT / "doc" / "modules" / "web-ui-redesign-handoff.md", REPO_ROOT / "docs" / "web-ui-redesign-tests.md", } for doc_root in (REPO_ROOT / "doc", REPO_ROOT / "docs"):