diff --git a/test/test_log.py b/test/test_log.py index 0d279f9fb..da808fee1 100644 --- a/test/test_log.py +++ b/test/test_log.py @@ -24,7 +24,7 @@ from ops.model import MAX_LOG_LINE_LEN, _ModelBackend -class FakeModelBackend: +class FakeModelBackend((_ModelBackend)): def __init__(self): self._calls : typing.List[typing.Tuple[str, str]] = [] @@ -49,7 +49,7 @@ def tearDown(self): logging.getLogger().handlers.clear() def test_default_logging(self): - ops.log.setup_root_logging(self.backend) # type: ignore + ops.log.setup_root_logging(self.backend) logger = logging.getLogger() self.assertEqual(logger.level, logging.DEBUG) @@ -72,7 +72,7 @@ def test_default_logging(self): def test_handler_filtering(self): logger = logging.getLogger() logger.setLevel(logging.INFO) - logger.addHandler(ops.log.JujuLogHandler(self.backend, logging.WARNING)) # type: ignore + logger.addHandler(ops.log.JujuLogHandler(self.backend, logging.WARNING)) logger.info('foo') self.assertEqual(self.backend.calls(), []) logger.warning('bar') @@ -81,7 +81,7 @@ def test_handler_filtering(self): def test_no_stderr_without_debug(self): buffer = io.StringIO() with patch('sys.stderr', buffer): - ops.log.setup_root_logging(self.backend, debug=False) # type: ignore + ops.log.setup_root_logging(self.backend, debug=False) logger = logging.getLogger() logger.debug('debug message') logger.info('info message') @@ -99,7 +99,7 @@ def test_no_stderr_without_debug(self): def test_debug_logging(self): buffer = io.StringIO() with patch('sys.stderr', buffer): - ops.log.setup_root_logging(self.backend, debug=True) # type: ignore + ops.log.setup_root_logging(self.backend, debug=True) logger = logging.getLogger() logger.debug('debug message') logger.info('info message') @@ -121,7 +121,7 @@ def test_debug_logging(self): ) def test_reduced_logging(self): - ops.log.setup_root_logging(self.backend) # type: ignore + ops.log.setup_root_logging(self.backend) logger = logging.getLogger() logger.setLevel(logging.WARNING) logger.debug('debug') @@ -133,7 +133,7 @@ def test_long_string_logging(self): buffer = io.StringIO() with patch('sys.stderr', buffer): - ops.log.setup_root_logging(self.backend, debug=True) # type: ignore + ops.log.setup_root_logging(self.backend, debug=True) logger = logging.getLogger() logger.debug('l' * MAX_LOG_LINE_LEN)