From cf473d4f3f881387bf07356965a82ddb673fd3b5 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 24 Dec 2025 17:25:07 +0100 Subject: [PATCH] Ruff formated --- src/matomo_bootstrap/installers/web.py | 7 ++++++- tests/integration/test_web_installer_warnings.py | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/matomo_bootstrap/installers/web.py b/src/matomo_bootstrap/installers/web.py index b5b2b54..f2a765f 100644 --- a/src/matomo_bootstrap/installers/web.py +++ b/src/matomo_bootstrap/installers/web.py @@ -41,6 +41,7 @@ def _page_warnings(page, *, prefix: str = "[install]") -> list[str]: - Prints found warnings/errors to stderr (stdout stays clean). - Returns a de-duplicated list of warning/error texts (empty if none found). """ + def _safe(s: str | None) -> str: return (s or "").strip() @@ -116,12 +117,16 @@ def _page_warnings(page, *, prefix: str = "[install]") -> list[str]: out.append(t) if out: - print(f"{prefix} page warnings/errors detected @ {url} ({title}):", file=sys.stderr) + print( + f"{prefix} page warnings/errors detected @ {url} ({title}):", + file=sys.stderr, + ) for idx, t in enumerate(out, 1): print(f"{prefix} {idx}) {t}", file=sys.stderr) return out + def wait_http(url: str, timeout: int = 180) -> None: """ Consider Matomo 'reachable' as soon as the HTTP server answers - even with 500. diff --git a/tests/integration/test_web_installer_warnings.py b/tests/integration/test_web_installer_warnings.py index 196af10..aa9858d 100644 --- a/tests/integration/test_web_installer_warnings.py +++ b/tests/integration/test_web_installer_warnings.py @@ -87,7 +87,9 @@ class TestWebInstallerWarningsIntegration(unittest.TestCase): Some Matomo versions repeat the same alert in multiple containers. We must return/log each unique text only once. """ - repeated = "Please fix the following errors:\nThe email doesn't have a valid format." + repeated = ( + "Please fix the following errors:\nThe email doesn't have a valid format." + ) page = _FakePage( url="http://matomo/index.php?action=setupSuperUser&module=Installation", title="Superuser",