From 533584e74628612f003e6d32fd11f3616d69a627 Mon Sep 17 00:00:00 2001 From: Sven Geboers Date: Fri, 1 May 2026 00:07:56 +0200 Subject: [PATCH] test(logging): fix null formatter pyright error in setup test Replace check with assertion to satisfy pyright's handler-type compatibility check. --- tests/test_logging_config.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/test_logging_config.py b/tests/test_logging_config.py index 20de16d..9636f07 100644 --- a/tests/test_logging_config.py +++ b/tests/test_logging_config.py @@ -30,9 +30,11 @@ class TestConfigureLogging: assert len(root.handlers) == 1 handler = root.handlers[0] formatter = handler.formatter - assert "%(name)s" in formatter._fmt - assert "%(levelname)s" in formatter._fmt - assert "%(asctime)s" in formatter._fmt + assert formatter is not None + fmt = formatter._fmt or "" + assert "%(name)s" in fmt + assert "%(levelname)s" in fmt + assert "%(asctime)s" in fmt def test_idempotent_second_call(self): self._clear_handlers()