diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-30 11:17:04 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-30 11:17:04 -0400 |
commit | 81ad085cffc8f8af7fb7884bcc5db6fcede09df6 (patch) | |
tree | a197a6c81767f10b62d6ac6acfd46e42357a8289 /tests/test_argparse.py | |
parent | 85a21ef39467dc24a6f6f8c4f3ac656f24d6ff90 (diff) | |
parent | 61d5703cd3586b3460669a6260cf903c9863b240 (diff) | |
download | cmd2-git-81ad085cffc8f8af7fb7884bcc5db6fcede09df6.tar.gz |
Merged master into transcript_fixes branch and resolved conflicts
Diffstat (limited to 'tests/test_argparse.py')
-rw-r--r-- | tests/test_argparse.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_argparse.py b/tests/test_argparse.py index 469cbe76..fdd16bcc 100644 --- a/tests/test_argparse.py +++ b/tests/test_argparse.py @@ -6,9 +6,9 @@ import argparse import pytest import cmd2 -from unittest import mock +from cmd2.utils import StdSim -from .conftest import run_cmd, StdOut +from .conftest import run_cmd # Prefer statically linked gnureadline if available (for macOS compatibility due to issues with libedit) try: @@ -115,7 +115,7 @@ class ArgparseApp(cmd2.Cmd): @pytest.fixture def argparse_app(): app = ArgparseApp() - app.stdout = StdOut() + app.stdout = StdSim(app.stdout) return app @@ -222,7 +222,7 @@ class SubcommandApp(cmd2.Cmd): @pytest.fixture def subcommand_app(): app = SubcommandApp() - app.stdout = StdOut() + app.stdout = StdSim(app.stdout) return app @@ -258,4 +258,3 @@ def test_subcommand_help(subcommand_app): def test_subcommand_invalid_help(subcommand_app): out = run_cmd(subcommand_app, 'help base baz') assert out[0].startswith('usage: base') - assert out[1].startswith("base: error: invalid choice: 'baz'") |