From a807a70556b148900f0b92e73dfd6a1f3c061397 Mon Sep 17 00:00:00 2001 From: latte Date: Wed, 14 Oct 2026 15:50:43 +0200 Subject: [PATCH] test: fix integration harness lint findings --- pyproject.toml | 5 +++++ tests/integration/harness.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b7e8d86..2c3a44a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -88,6 +88,11 @@ ignore = [ [tool.ruff.lint.per-file-ignores] "__init__.py" = ["F401"] +"tests/integration/harness.py" = [ + "S101", + "S603", # the harness drives the trusted local docker CLI with fixed argv + "S607", # docker is resolved from PATH on purpose (CI and local hosts differ) +] "tests/**" = [ "S101", # assert is the point of tests "S105", # hardcoded fake tokens in fixtures diff --git a/tests/integration/harness.py b/tests/integration/harness.py index 25fc2cc..83c8a69 100644 --- a/tests/integration/harness.py +++ b/tests/integration/harness.py @@ -12,6 +12,7 @@ and are excluded from ``repr`` and from every error message. from __future__ import annotations import atexit +import contextlib import os import secrets import signal @@ -136,10 +137,9 @@ def cleanup_resources(res: RunResources) -> None: def cleanup_all() -> None: """Clean every run still registered (atexit and signal path).""" for res in list(_ACTIVE.values()): - try: + # Best effort during interpreter exit: never let cleanup raise. + with contextlib.suppress(Exception): cleanup_resources(res) - except Exception: # noqa: BLE001 - best effort during interpreter exit - pass def _signal_handler(signum: int, frame: FrameType | None) -> None: