From 29a11a3aa155e41d38d4e63111bcfe28117fd33e Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 26 May 2015 13:28:36 -0700 Subject: [PATCH 1/2] use `super` in NotebookApp.start --- notebook/notebookapp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/notebook/notebookapp.py b/notebook/notebookapp.py index bbbb66f09..c07bedb3c 100644 --- a/notebook/notebookapp.py +++ b/notebook/notebookapp.py @@ -1065,8 +1065,7 @@ class NotebookApp(JupyterApp): This method takes no arguments so all configuration and initialization must be done prior to calling this method.""" - if self.subapp is not None: - return self.subapp.start() + super(NotebookApp, self).start() info = self.log.info for line in self.notebook_info().split("\n"): From 7db1410a116c9bfd08a8cc7fae42c5c461170781 Mon Sep 17 00:00:00 2001 From: Min RK Date: Tue, 26 May 2015 13:28:51 -0700 Subject: [PATCH 2/2] test --generate-config --- notebook/tests/test_notebookapp.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/notebook/tests/test_notebookapp.py b/notebook/tests/test_notebookapp.py index 111890c80..4119d0858 100644 --- a/notebook/tests/test_notebookapp.py +++ b/notebook/tests/test_notebookapp.py @@ -9,6 +9,7 @@ import nose.tools as nt from traitlets.tests.utils import check_help_all_output +from jupyter_core.application import NoStart from ipython_genutils.tempdir import TemporaryDirectory from traitlets import TraitError from notebook import notebookapp @@ -61,3 +62,11 @@ def test_invalid_nb_dir(): with nt.assert_raises(TraitError): app.notebook_dir = tf +def test_generate_config(): + with TemporaryDirectory() as td: + app = NotebookApp(config_dir=td) + app.initialize(['--generate-config']) + with nt.assert_raises(NoStart): + app.start() + assert os.path.exists(os.path.join(td, 'jupyter_notebook_config.py')) + \ No newline at end of file