diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_cmd2.py | 6 | ||||
| -rw-r--r-- | tests/test_pyscript.py | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 7a8a52a0..99c30af4 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -220,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): diff --git a/tests/test_pyscript.py b/tests/test_pyscript.py index d5b182c9..d5e5a4fb 100644 --- a/tests/test_pyscript.py +++ b/tests/test_pyscript.py @@ -140,7 +140,7 @@ def ps_echo(): ('help', 'help.py'), ('help media', 'help_media.py'), ]) -def test_pyscript_help(ps_app, capsys, request, command, pyscript_file): +def test_pyscript_help(ps_app, request, command, pyscript_file): test_dir = os.path.dirname(request.module.__file__) python_script = os.path.join(test_dir, 'pyscript', pyscript_file) expected = run_cmd(ps_app, command) @@ -169,7 +169,7 @@ def test_pyscript_help(ps_app, capsys, request, command, pyscript_file): ('foo 11 22 33 44 55 66 -ccc', 'foo3.py'), ('bar 11 22', 'bar1.py'), ]) -def test_pyscript_out(ps_app, capsys, request, command, pyscript_file): +def test_pyscript_out(ps_app, request, command, pyscript_file): test_dir = os.path.dirname(request.module.__file__) python_script = os.path.join(test_dir, 'pyscript', pyscript_file) expected = run_cmd(ps_app, command) |
