fix: skip the wide table check without a build

A missing page was a continue, so with no website/dist the test ran no assertion and reported ok.
This commit is contained in:
Abdessamad Derraz committed 2026-11-05 19:13:51 +01:00
1 parent 17538bcddf
commit ed100a5c08
1 file changed
+13 -4
+13 -4
View File
@@ -353,15 +353,24 @@ class WideTablesStackAndFiltersAreBuilt(unittest.TestCase):
def test_every_wide_table_stacks(self):
for page in ("emulators/duckstation", "gaps", "gaps-files-to-source", "emulators", "data",
"wiki/verification-modes"):
html = (DIST / page / "index.html")
if not html.is_file():
continue
for table in _tables(_read(html)):
for table in _tables(_built(page)):
if len(_headers(table)) < 4:
continue
with self.subTest(page=page, header=_headers(table)):
self.assertIn('data-rb-stack="true"', table.split(">", 1)[0])
def test_no_build_is_a_skip_not_a_pass(self):
"""Every missing page was a `continue`: with no build the test ran no
assertion and still reported ok."""
from unittest import mock
module = sys.modules[__name__]
case = WideTablesStackAndFiltersAreBuilt("test_every_wide_table_stacks")
result = unittest.TestResult()
with mock.patch.object(module, "DIST", REPO_ROOT / "tmp" / "no-such-dist"):
case.run(result)
self.assertEqual(len(result.skipped), 1)
def test_long_tables_get_their_labels_at_runtime(self):
"""Labels on every cell of a long stacked table were 122 KB of
emulators/mame and took it over the 600,000-byte page budget."""