@@ -0,0 +1,1214 @@
+import sys%0Aimport nose.tools as nt%0A%0Afrom subprocess import Popen, PIPE%0A%0Adef get_output_error_code(cmd):%0A    %22%22%22Get stdout, stderr, and exit code from running a command%22%22%22%0A    p = Popen(cmd, stdout=PIPE, stderr=PIPE)%0A    out, err = p.communicate()%0A    out = out.decode('utf8', 'replace')%0A    err = err.decode('utf8', 'replace')%0A    return out, err, p.returncode%0A%0A%0Adef check_help_output(pkg, subcommand=None):%0A    %22%22%22test that %60python -m PKG %5Bsubcommand%5D -h%60 works%22%22%22%0A    cmd = %5Bsys.executable, '-m', pkg%5D%0A    if subcommand:%0A        cmd.extend(subcommand)%0A    cmd.append('-h')%0A    out, err, rc = get_output_error_code(cmd)%0A    nt.assert_equal(rc, 0, err)%0A    nt.assert_not_in(%22Traceback%22, err)%0A    nt.assert_in(%22Options%22, out)%0A    nt.assert_in(%22--help-all%22, out)%0A    return out, err%0A%0A%0Adef check_help_all_output(pkg, subcommand=None):%0A    %22%22%22test that %60python -m PKG --help-all%60 works%22%22%22%0A    cmd = %5Bsys.executable, '-m', pkg%5D%0A    if subcommand:%0A        cmd.extend(subcommand)%0A    cmd.append('--help-all')%0A    out, err, rc = get_output_error_code(cmd)%0A    nt.assert_equal(rc, 0, err)%0A    nt.assert_not_in(%22Traceback%22, err)%0A    nt.assert_in(%22Options%22, out)%0A    nt.assert_in(%22Class parameters%22, out)%0A    return out, err%0A

add help output tests to traitlets.tests.utils