Skip to content

Commit 23aea60

Browse files
committed
Fix HfArgumentParserTest::test_valid_dict_annotation checks
Signed-off-by: cyy <[email protected]>
1 parent 0d46353 commit 23aea60

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/utils/test_hf_argparser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,12 @@ def test_valid_dict_annotation(self):
455455
args = get_args(field.type)
456456
# These should be returned as `dict`, `str`, ...
457457
# we only care about the first two
458-
self.assertIn(args[0], (dict, dict))
459-
self.assertEqual(
460-
str(args[1]),
461-
"<class 'str'>",
458+
self.assertIn(dict, args)
459+
self.assertIn(
460+
str,
461+
args,
462462
f"Expected field `{field.name}` to have a type signature of at least `typing.Union[dict,str,...]` for CLI compatibility, "
463-
"but `str` not found. Please fix this.",
463+
f"but `str` not found. Its type is {args}, Please fix this.",
464464
)
465465

466466
# Second check: anything in `optional_dict_fields` is bad if it's not in `base_list`

0 commit comments

Comments
 (0)