record PyJHora benchmark generation time

This commit is contained in:
732642856
2026-07-15 12:09:39 +08:00
parent 451cb45e31
commit 1534d827be
3 changed files with 20 additions and 3 deletions
+14
View File
@@ -1,7 +1,10 @@
import subprocess
import sys
from datetime import datetime, timezone
from pathlib import Path
from benchmarks.jyotish.scripts.run_pyjhora_compare import write_report
ROOT = Path(__file__).resolve().parents[1]
RUNNER = ROOT / "benchmarks" / "jyotish" / "scripts" / "run_pyjhora_compare.py"
@@ -16,3 +19,14 @@ def test_pyjhora_compare_help_is_non_executing():
assert "--build-local" in result.stdout
assert "--output-prefix" in result.stdout
assert "FileNotFoundError" not in result.stderr
def test_pyjhora_report_uses_supplied_utc_generation_timestamp():
report = write_report(
[],
[],
generated_at=datetime(2026, 7, 15, 4, 30, tzinfo=timezone.utc),
)
assert "生成时间:2026-07-15T04:30:00+00:00" in report
assert "生成时间:2026-06-03" not in report