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

Replace  check with  assertion to satisfy
pyright's handler-type compatibility check.
main
Sven Geboers 4 weeks ago
parent 14921e9256
commit 533584e746
  1. 8
      tests/test_logging_config.py

@ -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()

Loading…
Cancel
Save