diff --git a/IPython/terminal/tests/test_help.py b/IPython/terminal/tests/test_help.py index f217e20..d21c4fb 100644 --- a/IPython/terminal/tests/test_help.py +++ b/IPython/terminal/tests/test_help.py @@ -11,57 +11,45 @@ # Imports #----------------------------------------------------------------------------- -from IPython.testing.tools import help, help_all +import IPython.testing.tools as tt #----------------------------------------------------------------------------- # Tests #----------------------------------------------------------------------------- -@help() def test_ipython_help(): - pass + tt.help_output_test() -@help_all() def test_ipython_help_all(): - pass + tt.help_all_output_test() -@help("profile") def test_profile_help(): - pass + tt.help_output_test("profile") -@help_all("profile") def test_profile_help_all(): - pass + tt.help_all_output_test("profile") -@help("profile list") def test_profile_list_help(): - pass + tt.help_output_test("profile list") -@help_all("profile list") def test_profile_list_help_all(): - pass + tt.help_all_output_test("profile list") -@help("profile create") def test_profile_create_help(): - pass + tt.help_output_test("profile create") -@help_all("profile create") def test_profile_create_help_all(): - pass + tt.help_all_output_test("profile create") -@help("locate") def test_locate_help(): - pass + tt.help_output_test("locate") -@help_all("locate") def test_locate_help_all(): - pass + tt.help_all_output_test("locate") -@help("locate profile") def test_locate_profile_help(): - pass + tt.help_output_test("locate profile") -@help_all("locate profile") def test_locate_profile_all(): - pass + tt.help_all_output_test("locate profile") diff --git a/IPython/testing/tools.py b/IPython/testing/tools.py index 45c2034..f397c11 100644 --- a/IPython/testing/tools.py +++ b/IPython/testing/tools.py @@ -433,33 +433,3 @@ def help_all_output_test(subcommand=''): nt.assert_in("Class parameters", out) return out, err - -def help(cmd=''): - """decorator for making a test for `ipython cmd -h`""" - def wrap_help_test(f): - def test_help_output(): - out, err = help_output_test(cmd) - if inspect.getargspec(f).args: - return f(out, err) - else: - return f() - cmds = cmd + ' ' if cmd else '' - test_help_output.__doc__ = "ipython {cmds}--help-all works".format(cmds=cmds) - - return test_help_output - return wrap_help_test - - -def help_all(cmd=''): - """decorator for making a test for `ipython [cmd] --help-all`""" - def wrap_help_test(f): - def test_help_output(): - out, err = help_all_output_test(cmd) - if inspect.getargspec(f).args: - return f(out, err) - else: - return f() - cmds = cmd + ' ' if cmd else '' - test_help_output.__doc__ = "ipython {cmds}--help-all works".format(cmds=cmds) - return test_help_output - return wrap_help_test