diff --git a/IPython/config/tests/test_application.py b/IPython/config/tests/test_application.py index 97225d4..4269776 100644 --- a/IPython/config/tests/test_application.py +++ b/IPython/config/tests/test_application.py @@ -18,8 +18,11 @@ Authors: #----------------------------------------------------------------------------- import logging +from io import StringIO from unittest import TestCase +import nose.tools as nt + from IPython.config.configurable import Configurable from IPython.config.loader import Config @@ -80,6 +83,16 @@ class MyApp(Application): class TestApplication(TestCase): + def test_log(self): + stream = StringIO() + app = MyApp(log_level=logging.INFO) + handler = logging.StreamHandler(stream) + # trigger reconstruction of the log formatter + app.log.handlers = [handler] + app.log_format = "%(message)s" + app.log.info("hello") + nt.assert_in("hello", stream.getvalue()) + def test_basic(self): app = MyApp() self.assertEqual(app.name, u'myapp')