| 1234567891011121314151617181920212223242526272829 |
- """运行 Global Data 0.3 的小型离线 Eval 集。"""
- from __future__ import annotations
- import json
- from pathlib import Path
- import pytest
- def main() -> int:
- suite_dir = Path(__file__).resolve().parent
- repo_root = suite_dir.parents[1]
- cases = json.loads(
- (suite_dir / "cases.json").read_text(encoding="utf-8")
- )
- if not 5 <= len(cases) <= 10:
- raise ValueError("Global Data 0.3 Eval 必须保持 5–10 个案例")
- ids = [case["id"] for case in cases]
- if len(ids) != len(set(ids)):
- raise ValueError("Eval case id 不得重复")
- if "remote-url-content-replacement" not in ids:
- raise ValueError("Eval 必须包含远程 URL 内容替换对抗案例")
- selectors = [str(repo_root / case["test"]) for case in cases]
- return pytest.main(["-q", *selectors])
- if __name__ == "__main__":
- raise SystemExit(main())
|