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."""