from __future__ import annotations import subprocess import sys from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def test_publication_hygiene_gate_passes_for_tracked_tree() -> None: result = subprocess.run( [sys.executable, str(ROOT / "scripts" / "check_repository_hygiene.py")], cwd=ROOT, check=False, capture_output=True, text=True, ) assert result.returncode == 0, result.stderr def test_checkpoint_inspector_uses_weights_only_deserialization() -> None: inspector = (ROOT / "scripts" / "inspect_torch_checkpoint.py").read_text( encoding="utf-8" ) assert "weights_only=True" in inspector assert "weights_only=False" not in inspector