From 8b9d172805e18ab095ff42e5171c9a6a7785d6b2 Mon Sep 17 00:00:00 2001 From: dw-0 Date: Sat, 11 Jul 2026 00:27:03 +0200 Subject: [PATCH] test: suppress logger output globally during tests Add an autouse fixture in kiauh/conftest.py that patches Logger methods so tests produce clean, assertion-focused output. --- kiauh/conftest.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 kiauh/conftest.py diff --git a/kiauh/conftest.py b/kiauh/conftest.py new file mode 100644 index 00000000..ebf75aac --- /dev/null +++ b/kiauh/conftest.py @@ -0,0 +1,25 @@ +# ======================================================================= # +# Copyright (C) 2020 - 2026 Dominik Willner # +# # +# This file is part of KIAUH - Klipper Installation And Update Helper # +# https://github.com/dw-0/kiauh # +# # +# This file may be distributed under the terms of the GNU GPLv3 license # +# ======================================================================= # +from __future__ import annotations + +import pytest + + +@pytest.fixture(autouse=True) +def silence_logger(monkeypatch: pytest.MonkeyPatch) -> None: + """Suppress logger output so tests produce clean, assertion-focused output.""" + for name in ( + "print_info", + "print_ok", + "print_warn", + "print_error", + "print_status", + "print_dialog", + ): + monkeypatch.setattr(f"core.logger.Logger.{name}", lambda *a, **k: None)