typing: Fix compatibility with typed testtools, oslotest
Change-Id: Ie17b8b1bc6f7c03c5af437b3be4d17e145ced93a Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user