1111
1212
1313def test_on_field ():
14- v = SchemaValidator (schema = cs .str_schema (min_length = 2 , max_length = 5 ))
14+ v = SchemaValidator (cs .str_schema (min_length = 2 , max_length = 5 ))
1515 r = plain_repr (v )
1616 assert 'min_length:Some(2)' in r
1717 assert 'max_length:Some(5)' in r
@@ -20,14 +20,14 @@ def test_on_field():
2020
2121
2222def test_on_config ():
23- v = SchemaValidator (schema = cs .str_schema (), config = CoreConfig (str_max_length = 5 ))
23+ v = SchemaValidator (cs .str_schema (), config = CoreConfig (str_max_length = 5 ))
2424 assert 'max_length:Some(5)' in plain_repr (v )
2525 assert v .isinstance_python ('test' ) is True
2626 assert v .isinstance_python ('test long' ) is False
2727
2828
2929def test_field_priority_arg ():
30- v = SchemaValidator (schema = cs .str_schema (max_length = 5 ), config = CoreConfig (str_max_length = 10 ))
30+ v = SchemaValidator (cs .str_schema (max_length = 5 ), config = CoreConfig (str_max_length = 10 ))
3131 assert 'max_length:Some(5)' in plain_repr (v )
3232 assert v .isinstance_python ('test' ) is True
3333 assert v .isinstance_python ('test long' ) is False
@@ -40,7 +40,7 @@ class MyModel:
4040
4141def test_on_model_class ():
4242 v = SchemaValidator (
43- schema = cs .model_schema (
43+ cs .model_schema (
4444 cls = MyModel ,
4545 config = CoreConfig (str_max_length = 5 ),
4646 schema = cs .model_fields_schema (fields = {'f' : cs .model_field (schema = cs .str_schema ())}),
@@ -53,7 +53,7 @@ def test_on_model_class():
5353
5454def test_field_priority_model ():
5555 v = SchemaValidator (
56- schema = cs .model_schema (
56+ cs .model_schema (
5757 cls = MyModel ,
5858 config = CoreConfig (str_max_length = 10 ),
5959 schema = cs .model_fields_schema (fields = {'f' : cs .model_field (schema = cs .str_schema (max_length = 5 ))}),
@@ -103,7 +103,7 @@ def test_field_priority_model():
103103)
104104def test_allow_inf_nan (config : CoreConfig , float_field_schema , input_value , expected ):
105105 v = SchemaValidator (
106- schema = cs .model_schema (
106+ cs .model_schema (
107107 cls = MyModel ,
108108 schema = cs .model_fields_schema (fields = {'x' : cs .model_field (schema = float_field_schema )}),
109109 config = config ,
@@ -127,7 +127,7 @@ def test_allow_inf_nan(config: CoreConfig, float_field_schema, input_value, expe
127127)
128128def test_hide_input_in_errors (config , input_str ):
129129 v = SchemaValidator (
130- schema = cs .model_schema (
130+ cs .model_schema (
131131 cls = MyModel , schema = cs .model_fields_schema (fields = {'f' : cs .model_field (schema = cs .str_schema ())})
132132 ),
133133 config = config ,
@@ -138,14 +138,14 @@ def test_hide_input_in_errors(config, input_str):
138138
139139
140140def test_cache_strings ():
141- v = SchemaValidator (schema = cs .str_schema ())
141+ v = SchemaValidator (cs .str_schema ())
142142 assert 'cache_strings=True' in plain_repr (v )
143143
144- v = SchemaValidator (schema = cs .str_schema (), config = CoreConfig (cache_strings = True ))
144+ v = SchemaValidator (cs .str_schema (), config = CoreConfig (cache_strings = True ))
145145 assert 'cache_strings=True' in plain_repr (v )
146146
147- v = SchemaValidator (schema = cs .str_schema (), config = CoreConfig (cache_strings = False ))
147+ v = SchemaValidator (cs .str_schema (), config = CoreConfig (cache_strings = False ))
148148 assert 'cache_strings=False' in plain_repr (v )
149149
150- v = SchemaValidator (schema = cs .str_schema (), config = CoreConfig (cache_strings = 'keys' ))
150+ v = SchemaValidator (cs .str_schema (), config = CoreConfig (cache_strings = 'keys' ))
151151 assert "cache_strings='keys'" in plain_repr (v )
0 commit comments