From a195023d3dcce80e1d0a5c1d8801e9ce01a1afa9 Mon Sep 17 00:00:00 2001 From: Abdessamad Derraz <3028866+Abdess@users.noreply.github.com> Date: Fri, 6 Nov 2026 16:01:27 +0100 Subject: [PATCH] chore: run every test class when a file runs alone --- tests/test_contributing_text.py | 9 ++++----- tests/test_doc_pages.py | 10 ++++------ tests/test_doc_surfaces.py | 9 ++++----- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/tests/test_contributing_text.py b/tests/test_contributing_text.py index 10f9a3d9b..6999d8e35 100644 --- a/tests/test_contributing_text.py +++ b/tests/test_contributing_text.py @@ -35,7 +35,6 @@ class OneContributingText(unittest.TestCase): ) - class CoverageReadsTheGivenProfiles(unittest.TestCase): """generate_site --emulators-dir changed the emulator pages but not the platform coverage, which read ./emulators whatever was given.""" @@ -202,10 +201,6 @@ class OneFileThroughTheBrowser(unittest.TestCase): )) -if __name__ == "__main__": - unittest.main() - - class TheGuideRebuildsWhenItsPinsMove(unittest.TestCase): """The checklist quotes validate.yml, so a pin bump there must redeploy the guide and meet the README/CONTRIBUTING freshness check.""" @@ -282,3 +277,7 @@ class OneCommandRunsTheChecks(unittest.TestCase): self.assertIn("FAILED python -c raise(SystemExit(3)) (exit 3)", out.getvalue()) self.assertIn("NOT RUN no-such-tool-here --x", out.getvalue()) self.assertIn("1/3 checks passed", out.getvalue()) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_doc_pages.py b/tests/test_doc_pages.py index aa691ec21..aa106e1e9 100644 --- a/tests/test_doc_pages.py +++ b/tests/test_doc_pages.py @@ -1983,7 +1983,6 @@ class NoTextClaimsAScheduledScrape(unittest.TestCase): self.assertNotIn("list_platforms", workflow.read_text(encoding="utf-8")) - class TheCatalogRowsStateFacts(unittest.TestCase): """tools.md said "redump.org serves stale DATs" and "Dat-o-Matic blocks automation", verdicts on two preservation projects, and gave Redump's @@ -2001,11 +2000,6 @@ class TheCatalogRowsStateFacts(unittest.TestCase): self.assertIn("`/bios/`", rows[0]) -if __name__ == "__main__": - unittest.main() - - - class RegionFreeRuleNamesWhereItDoesNotHold(unittest.TestCase): """advanced-usage.md said psxonpsp660.bin is declared [world] and always survives --region. PCSX ReARMed declares it [japan], and on the platforms @@ -2099,3 +2093,7 @@ class LandingAChangeNamesTheCommitRules(unittest.TestCase): self.assertEqual(refused.returncode, 1, refused.stderr) self.assertIn("which review asked for it", refused.stderr) self.assertEqual(accepted.returncode, 0, accepted.stderr) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/test_doc_surfaces.py b/tests/test_doc_surfaces.py index 08a2702ba..e2c598931 100644 --- a/tests/test_doc_surfaces.py +++ b/tests/test_doc_surfaces.py @@ -434,8 +434,6 @@ class PagesOpenOnTheirContent(unittest.TestCase): self.assertEqual(announcing, []) - - class CoreCountsReadFromTheData(unittest.TestCase): """The cores page said "623 cores across 18 platforms": that was every profile, and 91 of them no platform runs.""" @@ -609,9 +607,6 @@ class EveryOptionExists(unittest.TestCase): if (bad := unknown_options(text))} self.assertEqual(wrong, {}) -if __name__ == "__main__": - unittest.main() - class ContributorChecksFetchThePlatformsFiles(unittest.TestCase): """validate.yml fetches each platform's own file before the suite. The @@ -636,3 +631,7 @@ class ContributorChecksFetchThePlatformsFiles(unittest.TestCase): def test_the_testing_guide_names_the_command(self): self.assertIn("export_native.py --all --fetch", _read("wiki/testing-guide.md")) + + +if __name__ == "__main__": + unittest.main()