test(logging): fix null formatter pyright error in setup test

Replace  check with  assertion to satisfy
pyright's handler-type compatibility check.
This commit is contained in:
2026-05-01 00:07:56 +02:00
parent 14921e9256
commit 533584e746
+5 -3
View File
@@ -30,9 +30,11 @@ class TestConfigureLogging:
assert len(root.handlers) == 1 assert len(root.handlers) == 1
handler = root.handlers[0] handler = root.handlers[0]
formatter = handler.formatter formatter = handler.formatter
assert "%(name)s" in formatter._fmt assert formatter is not None
assert "%(levelname)s" in formatter._fmt fmt = formatter._fmt or ""
assert "%(asctime)s" in formatter._fmt assert "%(name)s" in fmt
assert "%(levelname)s" in fmt
assert "%(asctime)s" in fmt
def test_idempotent_second_call(self): def test_idempotent_second_call(self):
self._clear_handlers() self._clear_handlers()