From ed100a5c082a30fe8bf92555ef5d1da76b2f8887 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Thu, 5 Nov 2026 19:13:51 +0100 Subject: [PATCH] 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. --- tests/test_site_components.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/test_site_components.py b/tests/test_site_components.py index 4bd277d60..20e06fd29 100644 --- a/tests/test_site_components.py +++ b/tests/test_site_components.py @@ -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."""