Fix failing integration test after adding test HTML presets

comparison.json was stale (built from 2 test presets only) while
modlist_html/ now has 4 files. Regenerated comparison.json from all
presets to restore consistency.

Also added _SkipTest exception to the test harness so the
consistency check skips gracefully on a fresh clone (comparison.json
is gitignored) instead of raising AssertionError.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
revernomad17
2026-04-08 15:37:56 +07:00
parent 57895a04d3
commit 85fdfebd74

View File

@@ -33,12 +33,19 @@ def group(name: str) -> None:
print(f"{'-'*60}") print(f"{'-'*60}")
class _SkipTest(Exception):
pass
def test(name: str, fn) -> None: def test(name: str, fn) -> None:
global _passed, _failed global _passed, _failed, _skipped
try: try:
fn() fn()
print(f" [PASS] {name}") print(f" [PASS] {name}")
_passed += 1 _passed += 1
except _SkipTest as exc:
print(f" [SKIP] {name} ({exc})")
_skipped += 1
except Exception as exc: except Exception as exc:
print(f" [FAIL] {name}") print(f" [FAIL] {name}")
for line in traceback.format_exc().splitlines(): for line in traceback.format_exc().splitlines():
@@ -1323,7 +1330,7 @@ def _test_comparison_json_consistent_with_html():
html_dir = Path(__file__).parent / "modlist_html" html_dir = Path(__file__).parent / "modlist_html"
json_file = Path(__file__).parent / "modlist_json" / "comparison.json" json_file = Path(__file__).parent / "modlist_json" / "comparison.json"
if not json_file.exists(): if not json_file.exists():
raise AssertionError(f"comparison.json not found: {json_file}") raise _SkipTest("comparison.json not found (run pipeline first)")
presets = parse_modlist_dir(html_dir) presets = parse_modlist_dir(html_dir)
fresh = compare_presets(*presets) fresh = compare_presets(*presets)