From 87762a257d2aef24f46db4bd539aed15908a7388 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:21:48 +0100 Subject: [PATCH] refactor: keep the retired text guard in one file The testing guide lists every test module and is not edited here, so the guard joins test_doc_surfaces, before its entry point. --- tests/test_doc_surfaces.py | 153 +++++++++++++++++++++++++++++- tests/test_site_retired_terms.py | 157 ------------------------------- 2 files changed, 151 insertions(+), 159 deletions(-) delete mode 100644 tests/test_site_retired_terms.py diff --git a/tests/test_doc_surfaces.py b/tests/test_doc_surfaces.py index d7cee518a..fd22b5cc5 100644 --- a/tests/test_doc_surfaces.py +++ b/tests/test_doc_surfaces.py @@ -9,10 +9,12 @@ tool prints, and a size is the one the release record holds. from __future__ import annotations +import ast import contextlib import re import sys import unittest +from functools import cache from pathlib import Path REPO_ROOT = Path(__file__).resolve().parent.parent @@ -398,8 +400,6 @@ class PagesOpenOnTheirContent(unittest.TestCase): self.assertEqual(announcing, []) -if __name__ == "__main__": - unittest.main() class CoreCountsReadFromTheData(unittest.TestCase): @@ -428,3 +428,152 @@ class CoreCountsReadFromTheData(unittest.TestCase): self.assertEqual(int(said[1].replace(",", "")), len(unique)) self.assertEqual(int(said[2].replace(",", "")), len(run)) self.assertEqual(int(said[3]), len(registry)) + + +# What the generators write must not bring back what the project retired. +# The generated pages, README.md, CONTRIBUTING.md and the site's components +# are read for a retired command, address or feature term, each listed with +# the reason it was retired, and for every `--option` a generated command +# passes: the script it names must declare it in its parser. The pages copied +# from wiki/ are left to their own tests: the installer page keeps the raw +# one-liner as the documented fallback. + + +def _sitepages(): + from tests import sitepages + + return sitepages + +# (string, why it is retired). Compared case-sensitively against the text. +RETIRED = ( + ("raw.githubusercontent.com/Abdess/retrobios/main/install.sh", + "the site serves the one-liner at https://abdess.github.io/retrobios/i " + "since 2026-10-28, pinned to the commit the site was built from"), + ("raw.githubusercontent.com/Abdess/retrobios/main/install.ps1", + "served at https://abdess.github.io/retrobios/i.ps1 since 2026-10-28"), + ("Abdess/retroarch_system", + "the repository was renamed retrobios in March 2026"), + ("mkdocs serve", "the MkDocs site was replaced by Astro Starlight on 2026-10-22"), + ("mkdocs build", "the MkDocs site was replaced by Astro Starlight on 2026-10-22"), + ("pip install mkdocs", "the site is built by Node from website/package-lock.json"), + ('class="rb-tested', "the Tested blocks were removed on 2026-10-28: " + "only Proof lines and the Measurements page remain"), + ("rb-region-runs", "region outcomes left the system pages on 2026-10-28"), + ("## Campaign", "the campaign table left the Measurements page on 2026-10-28"), + ("| Tested by |", "the coverage table left the Measurements page on 2026-10-28"), + ("ms per frame", "benchmark figures stay in the records and SQLite files, " + "never on a page, since 2026-10-28"), + ("with this BIOS folder as", "the Tested block of platform pages, removed on 2026-10-28"), + ("regenerated in its native format", "the export patches each platform's own " + "file and never regenerates it (scripts/exporter/base_exporter.py needs_original)"), +) + +COMMAND = re.compile( + r"(?:python3? (?P