mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Fix unit tests (#1630)
exception raised from `logging` module was breaking pytest
This commit is contained in:
+2
-1
@@ -43,7 +43,8 @@ class TestPatroniLogger(unittest.TestCase):
|
||||
_LOG.exception('test')
|
||||
logger.start()
|
||||
|
||||
with patch.object(logging.Handler, 'format', Mock(side_effect=Exception)):
|
||||
with patch.object(logging.Handler, 'format', Mock(side_effect=Exception)),\
|
||||
patch('_pytest.logging.LogCaptureHandler.emit', Mock()):
|
||||
logging.error('test')
|
||||
|
||||
self.assertEqual(logger.log_handler.maxBytes, config['log']['file_size'])
|
||||
|
||||
Reference in New Issue
Block a user