@@ -156,7 +156,7 @@ def test_subclass_union_help(parser):
156156 help_str = get_parser_help (parser )
157157 assert "Show the help for the given subclass of Calendar" in help_str
158158 help_str = get_parse_args_stdout (parser , ["--op.help" , "TextCalendar" ])
159- assert "--op.init_args. firstweekday" in help_str
159+ assert "--op.firstweekday" in help_str
160160
161161
162162class DefaultsDisabled :
@@ -204,8 +204,8 @@ def func_subclass_untyped(c1: Union[int, UntypedParams]):
204204def test_subclass_allow_untyped_parameters_help (parser ):
205205 parser .add_function_arguments (func_subclass_untyped , fail_untyped = False )
206206 help_str = get_parse_args_stdout (parser , [f"--c1.help={ __name__ } .UntypedParams" ])
207- assert "--c1.init_args. a1 A1" in help_str
208- assert "--c1.init_args. a2 A2" in help_str
207+ assert "--c1.a1 A1" in help_str
208+ assert "--c1.a2 A2" in help_str
209209
210210
211211class MergeInitArgs (Calendar ):
@@ -529,11 +529,12 @@ def test_subclass_nested_parse(parser, prefix):
529529
530530def test_subclass_nested_help (parser ):
531531 parser .add_argument ("--op" , type = Nested )
532- help_str = get_parse_args_stdout (parser , [f"--op.help={ __name__ } .Nested" , "--op.init_args.cal.help=TextCalendar" ])
533- assert "--op.init_args.cal.init_args.firstweekday" in help_str
532+ help_str = get_parse_args_stdout (parser , [f"--op.help={ __name__ } .Nested" , "--op.cal.help=TextCalendar" ])
533+ assert "Help for --op.cal.help=calendar.TextCalendar" in help_str
534+ assert "--op.cal.firstweekday" in help_str
534535
535536 with pytest .raises (ArgumentError ) as ctx :
536- parser .parse_args ([f"--op.help={ __name__ } .Nested" , "--op.init_args. p1=1" ])
537+ parser .parse_args ([f"--op.help={ __name__ } .Nested" , "--op.p1=1" ])
537538 ctx .match ("Expected a nested --\\ *.help option" )
538539
539540
@@ -580,7 +581,8 @@ def test_subclass_class_name_parse(parser):
580581def test_subclass_class_name_help (parser ):
581582 parser .add_argument ("--op" , type = Union [Calendar , GzipFile , None ])
582583 help_str = get_parse_args_stdout (parser , ["--op.help=GzipFile" ])
583- assert "--op.init_args.compresslevel" in help_str
584+ assert "Help for --op.help=gzip.GzipFile" in help_str
585+ assert "--op.compresslevel" in help_str
584586
585587
586588class LocaleTextCalendar (Calendar ):
@@ -1318,7 +1320,7 @@ def test_add_subclass_tuple(parser):
13181320 assert isinstance (init .c , TupleBaseB )
13191321
13201322 help_str = get_parse_args_stdout (parser , [f"--c.help={ __name__ } .TupleBaseB" ])
1321- assert "--c.init_args.b1 " in help_str
1323+ assert "--c.b1 B1 " in help_str
13221324
13231325
13241326def test_add_subclass_required_group (parser ):
0 commit comments