@@ -553,14 +553,14 @@ def test_path_fr_default_stdin(parser):
553553 assert defaults .path == Path_fr ("-" )
554554
555555
556- # enable_path tests
556+ # sub_configs tests
557557
558558
559- def test_enable_path_dict (parser , tmp_cwd ):
559+ def test_sub_configs_dict (parser , tmp_cwd ):
560560 data = {"a" : 1 , "b" : 2 , "c" : [3 , 4 ]}
561561 pathlib .Path ("data.yaml" ).write_text (json .dumps (data ))
562562
563- parser .add_argument ("--data" , type = Dict [str , Any ], enable_path = True )
563+ parser .add_argument ("--data" , type = Dict [str , Any ], sub_configs = True )
564564 cfg = parser .parse_args (["--data=data.yaml" ])
565565 assert "data.yaml" == str (cfg ["data" ].pop ("__path__" ))
566566 assert data == cfg ["data" ]
@@ -569,17 +569,17 @@ def test_enable_path_dict(parser, tmp_cwd):
569569 ctx .match ("Expected a path but does-not-exist.yaml either not accessible or invalid" )
570570
571571
572- def test_enable_path_subclass (parser , tmp_cwd ):
572+ def test_sub_configs_subclass (parser , tmp_cwd ):
573573 cal = {"class_path" : "calendar.Calendar" }
574574 pathlib .Path ("cal.yaml" ).write_text (json .dumps (cal ))
575575
576- parser .add_argument ("--cal" , type = Calendar , enable_path = True )
576+ parser .add_argument ("--cal" , type = Calendar , sub_configs = True )
577577 cfg = parser .parse_args (["--cal=cal.yaml" ])
578578 init = parser .instantiate (cfg )
579579 assert isinstance (init ["cal" ], Calendar )
580580
581581
582- def test_enable_path_list_path_fr (parser , tmp_cwd , mock_stdin , subtests ):
582+ def test_sub_configs_list_path_fr (parser , tmp_cwd , mock_stdin , subtests ):
583583 tmpdir = tmp_cwd / "subdir"
584584 tmpdir .mkdir ()
585585 (tmpdir / "file1" ).touch ()
@@ -599,13 +599,13 @@ def test_enable_path_list_path_fr(parser, tmp_cwd, mock_stdin, subtests):
599599 parser .add_argument (
600600 "--list" ,
601601 type = List [Path_fr ],
602- enable_path = True ,
602+ sub_configs = True ,
603603 )
604604 parser .add_argument (
605605 "--lists" ,
606606 nargs = "+" ,
607607 type = List [Path_fr ],
608- enable_path = True ,
608+ sub_configs = True ,
609609 )
610610
611611 with subtests .test ("paths list from file" ):
@@ -653,15 +653,15 @@ def test_enable_path_list_path_fr(parser, tmp_cwd, mock_stdin, subtests):
653653
654654@pytest .mark .parametrize ("validate_defaults" , [False , True ])
655655@patch_parsing_settings
656- def test_enable_path_list_path_fr_default_stdin (parser , tmp_cwd , validate_defaults , mock_stdin , subtests ):
656+ def test_sub_configs_list_path_fr_default_stdin (parser , tmp_cwd , validate_defaults , mock_stdin , subtests ):
657657 set_parsing_settings (validate_defaults = validate_defaults )
658658 (tmp_cwd / "file1" ).touch ()
659659 (tmp_cwd / "file2" ).touch ()
660660
661661 parser .add_argument (
662662 "--list" ,
663663 type = List [Path_fr ],
664- enable_path = True ,
664+ sub_configs = True ,
665665 default = "-" ,
666666 )
667667
@@ -712,11 +712,11 @@ def __init__(self, path: Optional[os.PathLike] = None):
712712 pass
713713
714714
715- def test_enable_path_optional_pathlike_subclass_parameter (parser , tmp_cwd ):
715+ def test_sub_configs_optional_pathlike_subclass_parameter (parser , tmp_cwd ):
716716 data_path = pathlib .Path ("data.json" )
717717 data_path .write_text ('{"a": 1}' )
718718
719- parser .add_argument ("--data" , type = DataOptionalPath , enable_path = True )
719+ parser .add_argument ("--data" , type = DataOptionalPath , sub_configs = True )
720720
721721 cfg = parser .parse_args ([f"--data={ __name__ } .DataOptionalPath" , f"--data.path={ data_path } " ])
722722 assert cfg .data .class_path == f"{ __name__ } .DataOptionalPath"
0 commit comments