refactor: keep shared test fixtures in helpers

Fifteen modules imported FakeRepository from test_install_selection, and
others read fixtures from test_install_app, test_install_offline,
test_install_games, test_launchers, test_prose_style, test_site_nav,
test_site_pronouns and test_site_copy. Those now live in installsupport,
gamessupport, launcherssupport, docpagessupport, sitepages and sitecopy,
and test_layers refuses an import of a test module.

sitereferencesupport and the DIST each site module defined merge into
sitepages, launchersretrobatsupport into launcherssupport, auditsupport
into the tests package (REPO_ROOT, HAS_JSONSCHEMA). test_launchers is the
Batocera module and becomes test_launchers_batocera. test_port becomes
test_handheld_port: its archive checks repeated test_handheld_scripts,
whose TheArchives now holds the port.json assertions.

The testing guide splits the row that held 113 modules, replaces the e2e
number ranges by a module table, gives package imports and scratch_dir in
How to add a test, lists every module that reads the working tree and
every helper module. Its guard moves to test_doc_pages_tools and checks
each module on one row once and each family on one row. The guide and
tools.md join the pages whose cited paths and options are looked up.
This commit is contained in:
Abdessamad Derraz committed 2026-11-24 10:10:15 +01:00
1 parent b2d4eee534
commit 74ba20ac10
73 files changed
+1718 -1585

No files matched your search

+10 -10
View File
@@ -20,7 +20,7 @@ from unittest import mock
from packs import verdicts
from scripts.resolve.localfile import resolve_local_file
from scripts.core.ziptools import safe_extract_zip
from tests.auditsupport import ROOT
from tests import REPO_ROOT
class AutoFetchReadsListsAndPlacesWithoutClobbering(unittest.TestCase):
@@ -348,14 +348,14 @@ class AnotherEmulatorsTreeProvesNothing(unittest.TestCase):
from scripts.model.platforms import load_platform_config
from scripts.model.targets import load_target_config
if not (ROOT / "database.json").exists():
if not (REPO_ROOT / "database.json").exists():
self.skipTest("database.json is not generated")
db = load_database(str(ROOT / "database.json"))
config = load_platform_config("retroarch", str(ROOT / "platforms"))
profiles = load_emulator_profiles(str(ROOT / "emulators"))
cores = set(load_target_config("retroarch", "x86_64", str(ROOT / "platforms")))
db = load_database(str(REPO_ROOT / "database.json"))
config = load_platform_config("retroarch", str(REPO_ROOT / "platforms"))
profiles = load_emulator_profiles(str(REPO_ROOT / "emulators"))
cores = set(load_target_config("retroarch", "x86_64", str(REPO_ROOT / "platforms")))
overrides = slots.pack_overrides(
config, profiles, db, None, load_data_dir_registry(str(ROOT / "platforms")),
config, profiles, db, None, load_data_dir_registry(str(REPO_ROOT / "platforms")),
target_cores=cores,
)
self.assertFalse([d for d, p in overrides.items() if "/armsx2/" in p])
@@ -614,9 +614,9 @@ class HashMergeBackupsAreNotSources(unittest.TestCase):
def test_the_backup_suffix_is_written_once(self):
offenders = [
str(path.relative_to(ROOT))
for path in sorted(ROOT.glob("scripts/**/*.py"))
if path.relative_to(ROOT).as_posix() != "scripts/model/profiles.py"
str(path.relative_to(REPO_ROOT))
for path in sorted(REPO_ROOT.glob("scripts/**/*.py"))
if path.relative_to(REPO_ROOT).as_posix() != "scripts/model/profiles.py"
and '".old.yml"' in path.read_text()
]
self.assertEqual(offenders, [])