diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-16 17:46:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-16 17:46:41 -0400 |
commit | 8e92f9dadb87e96852af8e5293ca26a4db0c64b0 (patch) | |
tree | de6fd37065cc48a8182951977c24114d2c6000c4 /tests/test_cmd2.py | |
parent | 177297ae557383215f3dae698ff43e1cf9daecca (diff) | |
parent | a36f1fff6bd058225dd0eaf63f45f3dfa34d338c (diff) | |
download | cmd2-git-8e92f9dadb87e96852af8e5293ca26a4db0c64b0.tar.gz |
Merge pull request #647 from python-cmd2/help_error
Help now writes to stderr when no help information is found
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r-- | tests/test_cmd2.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 44ca89e0..6733be19 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -952,10 +952,10 @@ undoc """) assert out == expected -def test_help_undocumented(help_app): - out = run_cmd(help_app, 'help undoc') - expected = normalize('*** No help on undoc') - assert out == expected +def test_help_undocumented(help_app, capsys): + run_cmd(help_app, 'help undoc') + out, err = capsys.readouterr() + assert err.startswith("No help on undoc") def test_help_overridden_method(help_app): out = run_cmd(help_app, 'help edit') @@ -1787,8 +1787,9 @@ def test_macro_create_with_escaped_args(base_app, capsys): assert out == normalize("Macro 'fake' created") # Run the macro - out = run_cmd(base_app, 'fake') - assert 'No help on {1}' in out[0] + run_cmd(base_app, 'fake') + out, err = capsys.readouterr() + assert err.startswith('No help on {1}') def test_macro_usage_with_missing_args(base_app, capsys): # Create the macro |