From d333016f740ec007c3502c17f6fc1599a54da1ae Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 7 Mar 2026 00:28:50 +0900 Subject: [PATCH] Fix new mypy errors Fix the following error currently detected in master. oslo_log/tests/unit/test_log.py:310:23: error: Argument 1 to "skipUnless" has incompatible type Module; expected "bool" [arg-type] Change-Id: Ia15ef85e2987d2b8e1e3f3a16936b8200bf07cdc Signed-off-by: Takashi Kajinami --- oslo_log/tests/unit/test_log.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/oslo_log/tests/unit/test_log.py b/oslo_log/tests/unit/test_log.py index cf5418bf..aa8479e8 100644 --- a/oslo_log/tests/unit/test_log.py +++ b/oslo_log/tests/unit/test_log.py @@ -307,7 +307,7 @@ class SysLogHandlersTestCase(BaseTestCase): self.assertEqual(expected.getMessage(), self.logger.format(logrecord)) -@testtools.skipUnless(syslog, "syslog is not available") +@testtools.skipIf(syslog is None, "syslog is not available") class OSSysLogHandlerTestCase(BaseTestCase): def test_handler(self): handler = handlers.OSSysLogHandler() @@ -367,7 +367,9 @@ class OSJournalHandlerTestCase(BaseTestCase): self.addCleanup(self.journal.stop) log.setup(self.CONF, 'testing') - @testtools.skipUnless(journal, "systemd journal binding is not available") + @testtools.skipIf( + journal is None, "systemd journal binding is not available" + ) def test_handler(self): handler = handlers.OSJournalHandler() handler.emit(