@@ -34,7 +34,11 @@ def validator_aok(request):
3434
3535@pytest .fixture
3636def validator_extras ():
37- return IntegerValidator ("prop" , "parent" , extras = ['normal' , 'bold' ])
37+ return IntegerValidator ("prop" , "parent" , min = - 2 , max = 10 , extras = ['normal' , 'bold' ])
38+
39+ @pytest .fixture
40+ def validator_extras_aok ():
41+ return IntegerValidator ("prop" , "parent" , min = - 2 , max = 10 , array_ok = True , extras = [['normal' , 'bold' ], ['italics' ]])
3842
3943# ### Acceptance ###
4044@pytest .mark .parametrize ("val" , [1 , - 19 , 0 , - 1234 ])
@@ -60,12 +64,17 @@ def test_acceptance_min_max(val, validator_min_max):
6064 assert validator_min_max .validate_coerce (val ) == approx (val )
6165
6266# With extras
63- @pytest .mark .parametrize ("val" , ['normal' , 'bold' ])
67+ @pytest .mark .parametrize ("val" , ['normal' , 'bold' , 10 , - 2 ])
6468def test_acceptance_extras (val , validator_extras ):
6569 assert validator_extras .validate_coerce (val ) == val
6670
71+ # Test extras for array_ok
72+ @pytest .mark .parametrize ("val" , [['normal' , 'bold' ], ['italics' ]])
73+ def test_acceptance_extras_array (val , validator_extras_aok ):
74+ assert validator_extras_aok .validate_coerce (val ) == val
75+
6776# Test rejection by extras
68- @pytest .mark .parametrize ("val" , ['italic' , 'bolditalic' ])
77+ @pytest .mark .parametrize ("val" , ['italic' , 'bolditalic' , - 3 , 11 ])
6978def test_rejection_extras (val , validator_extras ):
7079 with pytest .raises (ValueError ) as validation_failure :
7180 validator_extras .validate_coerce (val )
0 commit comments