Convert LoggingHandler to use sys.stdout.write

This commit is contained in:
Anthony Sottile 2014-04-13 18:36:14 -07:00
parent 3d5a360df4
commit 374ef75835
2 changed files with 7 additions and 8 deletions

View file

@ -19,7 +19,7 @@ def test_logging_handler_color():
handler = LoggingHandler(True, print_mock)
handler.emit(FakeLogRecord('hi', 'WARNING', 30))
print_mock.assert_called_once_with(
color.YELLOW + '[WARNING]' + color.NORMAL + ' hi',
color.YELLOW + '[WARNING]' + color.NORMAL + ' hi\n',
)
@ -28,5 +28,5 @@ def test_logging_handler_no_color():
handler = LoggingHandler(False, print_mock)
handler.emit(FakeLogRecord('hi', 'WARNING', 30))
print_mock.assert_called_once_with(
'[WARNING] hi',
'[WARNING] hi\n',
)