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 <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2026-03-07 00:28:50 +09:00
parent d0f0bf3ee5
commit d333016f74

View File

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