Skip to content

Commit b9d7a1c

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/utils/test_hf_argparser.py

Lines changed: 2 additions & 2 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))
458+
self.assertIn(args[0], (dict, str))
459459
self.assertEqual(
460460
str(args[1]),
461461
"<class 'str'>",
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+
"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)