diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-14 18:12:15 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-03-14 18:12:15 -0400 |
commit | d2147757107c22de4b425d750137dd703cdcc1b5 (patch) | |
tree | 842970aad887263b76c414acf00eb0f9005ce23a /tests/test_cmd2.py | |
parent | 177297ae557383215f3dae698ff43e1cf9daecca (diff) | |
download | cmd2-git-d2147757107c22de4b425d750137dd703cdcc1b5.tar.gz |
Help command now writes to stderr when there is no help information
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 |