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:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user