Neither to_html() (the profile HTML report) nor the newer compare_to_html() (#128) have any test coverage - there's no tests/test_report.py, and no other test file exercises HTML report generation at all.
That means a structural regression (an unclosed tag, a KeyError from a field profile()/compare() renamed, a broken f-string) would ship silently - CI is green today even though this code path has zero verification beyond a manual faircode profile --html/faircode compare --html smoke test.
Request: add tests/test_report.py with at least:
- a smoke test per function asserting well-formed output (valid
<!DOCTYPE>, balanced tags, no unescaped user data)
- a couple of assertions that key computed figures (score, PSI, drift level) actually appear in the rendered HTML, so a silent field-name drift is caught
Neither
to_html()(the profile HTML report) nor the newercompare_to_html()(#128) have any test coverage - there's notests/test_report.py, and no other test file exercises HTML report generation at all.That means a structural regression (an unclosed tag, a
KeyErrorfrom a fieldprofile()/compare()renamed, a broken f-string) would ship silently - CI is green today even though this code path has zero verification beyond a manualfaircode profile --html/faircode compare --htmlsmoke test.Request: add
tests/test_report.pywith at least:<!DOCTYPE>, balanced tags, no unescaped user data)