summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-24 23:24:48 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2018-09-24 23:24:48 -0400
commitf70d55bd7473b3e5d13add2be4fb8c1ce45a5a6c (patch)
tree33b1117880854439bf5432473bf9c890df0687bf /tests/test_cmd2.py
parentb918b22c65a3f2370e028caabf4548240dcbc661 (diff)
parent3c51b9f32d35c05847c302646575dab576430a01 (diff)
downloadcmd2-git-f70d55bd7473b3e5d13add2be4fb8c1ce45a5a6c.tar.gz
Merge branch 'master' into alert_printer
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index 3ab7796d..10c60d71 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -46,6 +46,11 @@ def test_base_help_verbose(base_app):
expected = normalize(BASE_HELP_VERBOSE)
assert out == expected
+ # Make sure :param type lines are filtered out of help summary
+ help_doc = base_app.do_help.__func__.__doc__
+ help_doc += "\n:param fake param"
+ base_app.do_help.__func__.__doc__ = help_doc
+
out = run_cmd(base_app, 'help --verbose')
assert out == expected
@@ -215,13 +220,13 @@ def test_base_run_pyscript(base_app, capsys, request):
out, err = capsys.readouterr()
assert out == expected
-def test_recursive_pyscript_not_allowed(base_app, capsys, request):
+def test_recursive_pyscript_not_allowed(base_app, request):
test_dir = os.path.dirname(request.module.__file__)
python_script = os.path.join(test_dir, 'scripts', 'recursive.py')
- expected = 'ERROR: Recursively entering interactive Python consoles is not allowed.\n'
+ expected = 'Recursively entering interactive Python consoles is not allowed.'
run_cmd(base_app, "pyscript {}".format(python_script))
- out, err = capsys.readouterr()
+ err = base_app._last_result.stderr
assert err == expected
def test_pyscript_with_nonexist_file(base_app, capsys):