summaryrefslogtreecommitdiff
path: root/tests/test_argparse.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-08-27 13:19:23 -0400
committerGitHub <noreply@github.com>2020-08-27 13:19:23 -0400
commitf4943a904efba05c13eb930b4a4535c19429c72c (patch)
treecbaff855e2d73f1d86ae1230f32770e31c62ad6b /tests/test_argparse.py
parent97c348c599d8fa963553593e5c19fb100b85e313 (diff)
parent478ea83336a4d1659ad06ef365db3dc5e051e46d (diff)
downloadcmd2-git-f4943a904efba05c13eb930b4a4535c19429c72c.tar.gz
Merge pull request #985 from python-cmd2/dynamic_value
Added Cmd2AttributeWrapper class
Diffstat (limited to 'tests/test_argparse.py')
-rw-r--r--tests/test_argparse.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/test_argparse.py b/tests/test_argparse.py
index 9806c9b5..20d05bed 100644
--- a/tests/test_argparse.py
+++ b/tests/test_argparse.py
@@ -289,7 +289,6 @@ class SubcommandApp(cmd2.Cmd):
func = getattr(args, 'func')
func(self, args)
-
# Add a subcommand using as_subcommand_to decorator
has_subcmd_parser = cmd2.Cmd2ArgumentParser(description="Tests as_subcmd_to decorator")
has_subcmd_subparsers = has_subcmd_parser.add_subparsers(dest='subcommand', metavar='SUBCOMMAND')
@@ -297,7 +296,7 @@ class SubcommandApp(cmd2.Cmd):
@cmd2.with_argparser(has_subcmd_parser)
def do_test_subcmd_decorator(self, args: argparse.Namespace):
- handler = args.get_handler()
+ handler = args.cmd2_handler.get()
handler(args)
subcmd_parser = cmd2.Cmd2ArgumentParser(add_help=False, description="The subcommand")
@@ -306,7 +305,7 @@ class SubcommandApp(cmd2.Cmd):
def subcmd_func(self, args: argparse.Namespace):
# Make sure printing the Namespace works. The way we originally added get_hander()
# to it resulted in a RecursionError when printing.
- print(args)
+ self.poutput(args)
@pytest.fixture
def subcommand_app():