Ruff formated
Some checks failed
ci / tests (push) Has been cancelled

This commit is contained in:
Kevin Veen-Birkenbach
2025-12-24 17:25:07 +01:00
parent 84323bd2aa
commit cf473d4f3f
2 changed files with 9 additions and 2 deletions

View File

@@ -41,6 +41,7 @@ def _page_warnings(page, *, prefix: str = "[install]") -> list[str]:
- Prints found warnings/errors to stderr (stdout stays clean). - Prints found warnings/errors to stderr (stdout stays clean).
- Returns a de-duplicated list of warning/error texts (empty if none found). - Returns a de-duplicated list of warning/error texts (empty if none found).
""" """
def _safe(s: str | None) -> str: def _safe(s: str | None) -> str:
return (s or "").strip() return (s or "").strip()
@@ -116,12 +117,16 @@ def _page_warnings(page, *, prefix: str = "[install]") -> list[str]:
out.append(t) out.append(t)
if out: 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): for idx, t in enumerate(out, 1):
print(f"{prefix} {idx}) {t}", file=sys.stderr) print(f"{prefix} {idx}) {t}", file=sys.stderr)
return out return out
def wait_http(url: str, timeout: int = 180) -> None: def wait_http(url: str, timeout: int = 180) -> None:
""" """
Consider Matomo 'reachable' as soon as the HTTP server answers - even with 500. Consider Matomo 'reachable' as soon as the HTTP server answers - even with 500.

View File

@@ -87,7 +87,9 @@ class TestWebInstallerWarningsIntegration(unittest.TestCase):
Some Matomo versions repeat the same alert in multiple containers. Some Matomo versions repeat the same alert in multiple containers.
We must return/log each unique text only once. 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( page = _FakePage(
url="http://matomo/index.php?action=setupSuperUser&module=Installation", url="http://matomo/index.php?action=setupSuperUser&module=Installation",
title="Superuser", title="Superuser",