Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_logging_handlers: Fix a type: ignore issue.

Anders Kaseorg6ca8239124ee
diff --git a/zerver/tests/test_logging_handlers.py b/zerver/tests/test_logging_handlers.py
index b807e4e39da..b876c9178a9 100644
--- a/zerver/tests/test_logging_handlers.py
+++ b/zerver/tests/test_logging_handlers.py
@@ -194,7 +194,7 @@ class LoggingConfigTest(TestCase):
def all_loggers() -> Iterator[logging.Logger]:
# There is no documented API for enumerating the loggers; but the
# internals of `logging` haven't changed in ages, so just use them.
- loggerDict = logging.Logger.manager.loggerDict # type: ignore[attr-defined]
+ loggerDict: Dict[str, object] = getattr(logging.Logger, "manager").loggerDict
for logger in loggerDict.values():
if not isinstance(logger, logging.Logger):
continue