From 50b31960b30d75166ed65e9d0d41fdb0ca51d0c3 Mon Sep 17 00:00:00 2001 From: MinRK Date: Wed, 28 Aug 2013 11:18:02 -0700 Subject: [PATCH 1/2] test that `-h` and `--help-all` work for various IPython entry points should help catch when we break these things. --- IPython/html/tests/test_notebookapp.py | 29 ++++++++++++++++++++++++++ IPython/qt/console/tests/test_app.py | 29 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 IPython/html/tests/test_notebookapp.py create mode 100644 IPython/qt/console/tests/test_app.py diff --git a/IPython/html/tests/test_notebookapp.py b/IPython/html/tests/test_notebookapp.py new file mode 100644 index 000000000..24c0e6204 --- /dev/null +++ b/IPython/html/tests/test_notebookapp.py @@ -0,0 +1,29 @@ +"""Test NotebookApp""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import nose.tools as nt + +import IPython.testing.tools as tt + +#----------------------------------------------------------------------------- +# Test functions +#----------------------------------------------------------------------------- + +def test_help_output(): + """ipython notebook -h works""" + tt.help_output_test('notebook') + +def test_help_all_output(): + """ipython notebook --help-all works""" + tt.help_all_output_test('notebook') + diff --git a/IPython/qt/console/tests/test_app.py b/IPython/qt/console/tests/test_app.py new file mode 100644 index 000000000..8a8d44662 --- /dev/null +++ b/IPython/qt/console/tests/test_app.py @@ -0,0 +1,29 @@ +"""Test QtConsoleApp""" + +#----------------------------------------------------------------------------- +# Copyright (C) 2013 The IPython Development Team +# +# Distributed under the terms of the BSD License. The full license is in +# the file COPYING, distributed as part of this software. +#----------------------------------------------------------------------------- + +#----------------------------------------------------------------------------- +# Imports +#----------------------------------------------------------------------------- + +import nose.tools as nt + +import IPython.testing.tools as tt + +#----------------------------------------------------------------------------- +# Test functions +#----------------------------------------------------------------------------- + +def test_help_output(): + """ipython qtconsole -h works""" + tt.help_output_test('qtconsole') + +def test_help_all_output(): + """ipython qtconsole --help-all works""" + tt.help_all_output_test('qtconsole') + From 80d2d15620b86185afa3b7a9266752c67b63a1ae Mon Sep 17 00:00:00 2001 From: MinRK Date: Thu, 29 Aug 2013 17:24:04 -0700 Subject: [PATCH 2/2] only test `--help-all` help-all is a superset of `-h`, so no need to do both, since these tests are slow. --- IPython/html/tests/test_notebookapp.py | 4 ---- IPython/qt/console/tests/test_app.py | 4 ---- 2 files changed, 8 deletions(-) diff --git a/IPython/html/tests/test_notebookapp.py b/IPython/html/tests/test_notebookapp.py index 24c0e6204..56509cdc9 100644 --- a/IPython/html/tests/test_notebookapp.py +++ b/IPython/html/tests/test_notebookapp.py @@ -20,10 +20,6 @@ import IPython.testing.tools as tt #----------------------------------------------------------------------------- def test_help_output(): - """ipython notebook -h works""" - tt.help_output_test('notebook') - -def test_help_all_output(): """ipython notebook --help-all works""" tt.help_all_output_test('notebook') diff --git a/IPython/qt/console/tests/test_app.py b/IPython/qt/console/tests/test_app.py index 8a8d44662..d28596e1d 100644 --- a/IPython/qt/console/tests/test_app.py +++ b/IPython/qt/console/tests/test_app.py @@ -20,10 +20,6 @@ import IPython.testing.tools as tt #----------------------------------------------------------------------------- def test_help_output(): - """ipython qtconsole -h works""" - tt.help_output_test('qtconsole') - -def test_help_all_output(): """ipython qtconsole --help-all works""" tt.help_all_output_test('qtconsole')