diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-15 00:39:52 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-01-15 00:39:52 -0500 |
commit | 2fcc883f8a7fd5c9fd3beb30465cfa2b86c66ffc (patch) | |
tree | 6a0eb3761807af79fda34ff585ba364d4fdb210c | |
parent | 6b5d3629e5dcfd729d8023f9f0b39fed16b2e357 (diff) | |
download | cmd2-git-2fcc883f8a7fd5c9fd3beb30465cfa2b86c66ffc.tar.gz |
Fixed base_invalid_option unit test
argparse output for invalid option has different text and goes to stderr
-rw-r--r-- | tests/test_cmd2.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index c095bbba..156b9a73 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -54,10 +54,9 @@ def test_base_invalid_option(base_app, capsys): run_cmd(base_app, 'show -z') out, err = capsys.readouterr() show_help = run_cmd(base_app, 'help show') - expected = ['no such option: -z'] - expected.extend(show_help) + expected = ['usage: show [-h] [-l] [param]', 'show: error: unrecognized arguments: -z'] # 'show -h' is the same as 'help show', other than whitespace differences of an extra newline present in 'help show' - assert normalize(str(out)) == expected + assert normalize(str(err)) == expected def test_base_shortcuts(base_app): out = run_cmd(base_app, 'shortcuts') |