Skip to content

Commit ab4e9b1

Browse files
committed
Simplify test parameters
1 parent 2639813 commit ab4e9b1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

‎tests/validators/arguments_v3/test_extra.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
@pytest.mark.parametrize(
1212
'schema_extra_behavior,validate_fn_extra_kw',
1313
[
14-
({'extra_behavior': 'forbid'}, None),
15-
({'extra_behavior': 'ignore'}, 'forbid'),
14+
('forbid', None),
15+
('ignore', 'forbid'),
1616
],
1717
)
1818
@pytest.mark.parametrize(
@@ -37,7 +37,7 @@ def test_extra_forbid(
3737
cs.arguments_v3_parameter(name='a', schema=cs.int_schema()),
3838
cs.arguments_v3_parameter(name='b', schema=cs.int_schema(), alias='c'),
3939
],
40-
**schema_extra_behavior,
40+
extra_behavior=schema_extra_behavior,
4141
),
4242
)
4343

‎tests/validators/test_model.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class MyModel:
5050
@pytest.mark.parametrize(
5151
'schema_extra_behavior,validate_fn_extra_kw',
5252
[
53-
({'extra_behavior': 'allow'}, None),
54-
({'extra_behavior': 'ignore'}, 'allow'),
53+
('allow', None),
54+
('ignore', 'allow'),
5555
],
5656
)
5757
def test_model_class_extra(schema_extra_behavior: dict[str, Any], validate_fn_extra_kw: Union[ExtraBehavior, None]):
@@ -69,7 +69,7 @@ class MyModel:
6969
'field_a': core_schema.model_field(core_schema.str_schema()),
7070
'field_b': core_schema.model_field(core_schema.int_schema()),
7171
},
72-
**schema_extra_behavior,
72+
extra_behavior=schema_extra_behavior,
7373
),
7474
)
7575
)
@@ -85,8 +85,8 @@ class MyModel:
8585
@pytest.mark.parametrize(
8686
'schema_extra_behavior,validate_fn_extra_kw',
8787
[
88-
({'extra_behavior': 'forbid'}, None),
89-
({'extra_behavior': 'ignore'}, 'forbid'),
88+
('forbid', None),
89+
('ignore', 'forbid'),
9090
],
9191
)
9292
def test_model_class_extra_forbid(
@@ -119,7 +119,7 @@ def __getattr__(self, key):
119119
'field_a': core_schema.model_field(core_schema.str_schema()),
120120
'field_b': core_schema.model_field(core_schema.int_schema()),
121121
},
122-
**schema_extra_behavior,
122+
extra_behavior=schema_extra_behavior,
123123
),
124124
)
125125
)

0 commit comments

Comments
 (0)