diff options
Diffstat (limited to 'tests/test_argparse_custom.py')
| -rw-r--r-- | tests/test_argparse_custom.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/tests/test_argparse_custom.py b/tests/test_argparse_custom.py index dcfb7d9f..fccccd43 100644 --- a/tests/test_argparse_custom.py +++ b/tests/test_argparse_custom.py @@ -247,28 +247,26 @@ def test_apcustom_required_options(): def test_override_parser(): + """Test overriding argparse_custom.DEFAULT_ARGUMENT_PARSER""" import importlib from cmd2 import ( - DEFAULT_ARGUMENT_PARSER, + argparse_custom, ) # The standard parser is Cmd2ArgumentParser - assert DEFAULT_ARGUMENT_PARSER == Cmd2ArgumentParser + assert argparse_custom.DEFAULT_ARGUMENT_PARSER == Cmd2ArgumentParser # Set our parser module and force a reload of cmd2 so it loads the module argparse.cmd2_parser_module = 'examples.custom_parser' importlib.reload(cmd2) - from cmd2 import ( - DEFAULT_ARGUMENT_PARSER, - ) # Verify DEFAULT_ARGUMENT_PARSER is now our CustomParser from examples.custom_parser import ( CustomParser, ) - assert DEFAULT_ARGUMENT_PARSER == CustomParser + assert argparse_custom.DEFAULT_ARGUMENT_PARSER == CustomParser def test_apcustom_metavar_tuple(): |
