refactor: put scripts/ on the test path once

tests/__init__ now puts the repository root and scripts/ on sys.path,
so no test module inserts them and every import sits in the import
block. ruff accepts the bare `import tests` the modules keep for its
side effects. The last suppressions go: helper test modules import as
tests.<name>, files open in with blocks, lambdas become functions.
This commit is contained in:
Abdessamad Derraz committed 2026-11-17 16:11:23 +01:00
1 parent 8f1b88bb7e
commit 5f18caec31
281 files changed
+1036 -1659

No files matched your search

+8 -10
View File
@@ -21,12 +21,11 @@ are built, the pages and the site.
"""
from __future__ import annotations
import tests # noqa: F401 offline, scratch under tmp/, the suite's own cache
import tests
import json
import re
import struct
import sys
import tempfile
import unittest
from html.parser import HTMLParser
@@ -34,17 +33,18 @@ from pathlib import Path
import ast
from html import unescape
REPO_ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(REPO_ROOT / "scripts"))
import generate_site # noqa: E402
import sitestarlight # noqa: E402
from common import ( # noqa: E402
import generate_site
import sitestarlight
from common import (
list_registered_platforms,
load_platform_config,
load_platform_registry,
)
from siteguides import DEVICE_GROUPS
REPO_ROOT = Path(__file__).resolve().parents[1]
DIST = REPO_ROOT / "website" / "dist"
ROUTE = REPO_ROOT / "website" / "src" / "routeData.ts"
TAB_ROOTS = {"/retrobios/", "/retrobios/platforms/", "/retrobios/explore/",
@@ -72,8 +72,6 @@ def _targets(value: object) -> set[str]:
def _present(nav: list) -> set[str]:
return {t for t in _targets(nav) if not t.startswith("http")}
from siteguides import DEVICE_GROUPS # noqa: E402
def _index_anchors(markdown: str) -> set[str]:
"""The heading ids a generated page carries once written."""