29
29
from transformers import HfArgumentParser , TrainingArguments
30
30
from transformers .hf_argparser import make_choice_type_function , string_to_bool
31
31
from transformers .testing_utils import require_torch
32
- from transformers .training_args import _VALID_DICT_FIELDS
33
32
34
33
35
34
# Since Python 3.10, we can use the builtin `|` operator for Union types
@@ -412,7 +411,8 @@ def test_parse_yaml(self):
412
411
args = BasicExample (** args_dict_for_yaml )
413
412
self .assertEqual (parsed_args , args )
414
413
415
- def test_integration_training_args (self ):
414
+ def test_z_integration_training_args (self ):
415
+ # make sure that this test executes last in the test suite
416
416
parser = HfArgumentParser (TrainingArguments )
417
417
self .assertIsNotNone (parser )
418
418
@@ -424,7 +424,7 @@ def test_valid_dict_annotation(self):
424
424
If this fails, a type annotation change is
425
425
needed on a new input
426
426
"""
427
- base_list = _VALID_DICT_FIELDS .copy ()
427
+ base_list = TrainingArguments . _VALID_DICT_FIELDS .copy ()
428
428
args = TrainingArguments
429
429
430
430
# First find any annotations that contain `dict`
@@ -468,7 +468,7 @@ def test_valid_dict_annotation(self):
468
468
self .assertIn (
469
469
field .name ,
470
470
base_list ,
471
- f"Optional dict field `{ field .name } ` is not in the base list of valid fields. Please add it to `training_args ._VALID_DICT_FIELDS`" ,
471
+ f"Optional dict field `{ field .name } ` is not in the base list of valid fields. Please add it to `TrainingArguments ._VALID_DICT_FIELDS`" ,
472
472
)
473
473
474
474
@require_torch
0 commit comments