Skip to content

Commit

Permalink
Prevent autoformating of test parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerzy Zagorski committed Oct 3, 2024
1 parent f93ec21 commit 63dcb6c
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions tests/engine/test_arg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,38 @@ def test_bad_nullable_kvs(arg):
nullable_kvs(arg)


# yapf: disable
@pytest.mark.parametrize(("arg", "expected", "option"), [
(None, None, "mm-processor-kwargs"),
("{}", {}, "mm-processor-kwargs"),
('{"num_crops": 4}', {
"num_crops": 4
}, "mm-processor-kwargs"),
('{"foo": {"bar": "baz"}}', {
"foo": {
"bar": "baz"
}
}, "mm-processor-kwargs"),
('{"cast_logits_dtype":"bfloat16","sequence_parallel_norm":true,"sequence_parallel_norm_threshold":2048}',
{
"cast_logits_dtype": "bfloat16",
"sequence_parallel_norm": True,
"sequence_parallel_norm_threshold": 2048,
}, "override-neuron-config"),
(
'{"num_crops": 4}',
{
"num_crops": 4
},
"mm-processor-kwargs"
),
(
'{"foo": {"bar": "baz"}}',
{
"foo":
{
"bar": "baz"
}
},
"mm-processor-kwargs"
),
(
'{"cast_logits_dtype":"bfloat16","sequence_parallel_norm":true,"sequence_parallel_norm_threshold":2048}',
{
"cast_logits_dtype": "bfloat16",
"sequence_parallel_norm": True,
"sequence_parallel_norm_threshold": 2048,
},
"override-neuron-config"
),
])
# yapf: enable
def test_composite_arg_parser(arg, expected, option):
parser = EngineArgs.add_cli_args(FlexibleArgumentParser())
if arg is None:
Expand Down

0 comments on commit 63dcb6c

Please sign in to comment.