typing: Fix compatibility with typed testtools, oslotest

Change-Id: Ie17b8b1bc6f7c03c5af437b3be4d17e145ced93a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane
2026-04-05 22:47:10 +01:00
parent b184af867f
commit 5ae896b54d
3 changed files with 7 additions and 1 deletions
@@ -111,6 +111,7 @@ class TestDaemon(base.BaseTestCase):
def test_logging(self):
logs()
assert self.log_fixture.logger is not None
self.assertIn('foo', self.log_fixture.logger.output)
+3 -1
View File
@@ -134,11 +134,13 @@ class LogTest(testctx.TestContextTestCase):
record = logs[0]
self.assertIn('test with exc', record.getMessage())
self.assertIsNone(record.exc_info)
self.assertIsNotNone(record.exc_text)
assert record.exc_text is not None
self.assertIn('TestException: with arg', record.exc_text)
self.assertIn('test_daemon.py', record.exc_text)
self.assertEqual(
'PrivContext(cfg_section=privsep)', record.processName
)
self.assertIn('test_daemon.py', record.exc_text)
self.assertEqual(logging.WARNING, record.levelno)
self.assertEqual('logme', record.funcName)
+3
View File
@@ -65,3 +65,6 @@ docstring-code-format = true
[tool.ruff.lint]
select = ["E4", "E5", "E7", "E9", "F", "G", "LOG", "S", "UP"]
external = ["H"]
[tool.ruff.lint.per-file-ignores]
"oslo_privsep/tests/*" = ["S101"]