def parse_args(self, *args, **kwargs): fail_on_exc = kwargs.get('fail_on_exc', True) try: return parse_args( self.format_args( *args ) ) except SystemExit as e: if fail_on_exc: self.fail( "Parse Error" ) else: raise
def test_parser_simple(self): """ Check the parser returns a sane type :return: """ parser = parse_args( () ) self.assertIsNotNone( parser ) self.assertTrue( isinstance( parser, argparse.Namespace ) )