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.
This commit is contained in:
dw-0
2026-07-11 00:27:03 +02:00
parent 6aa170fd68
commit 8b9d172805
+25
View File
@@ -0,0 +1,25 @@
# ======================================================================= #
# Copyright (C) 2020 - 2026 Dominik Willner <th33xitus@gmail.com> #
# #
# 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)