Skip to content

Commit 013f74a

Browse files
committed
fix test case about TrainingArguments
1 parent 5e703eb commit 013f74a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/utils/test_hf_argparser.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from transformers import HfArgumentParser, TrainingArguments
3030
from transformers.hf_argparser import make_choice_type_function, string_to_bool
3131
from transformers.testing_utils import require_torch
32-
from transformers.training_args import _VALID_DICT_FIELDS
3332

3433

3534
# Since Python 3.10, we can use the builtin `|` operator for Union types
@@ -412,7 +411,8 @@ def test_parse_yaml(self):
412411
args = BasicExample(**args_dict_for_yaml)
413412
self.assertEqual(parsed_args, args)
414413

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
416416
parser = HfArgumentParser(TrainingArguments)
417417
self.assertIsNotNone(parser)
418418

@@ -424,7 +424,7 @@ def test_valid_dict_annotation(self):
424424
If this fails, a type annotation change is
425425
needed on a new input
426426
"""
427-
base_list = _VALID_DICT_FIELDS.copy()
427+
base_list = TrainingArguments._VALID_DICT_FIELDS.copy()
428428
args = TrainingArguments
429429

430430
# First find any annotations that contain `dict`
@@ -468,7 +468,7 @@ def test_valid_dict_annotation(self):
468468
self.assertIn(
469469
field.name,
470470
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`",
472472
)
473473

474474
@require_torch

0 commit comments

Comments
 (0)