55from openfisca_core import commons
66
77
8- def test_apply_thresholds_when_several_inputs ():
8+ def test_apply_thresholds_when_several_inputs () -> None :
99 """Makes a choice for any given input."""
10-
1110 input_ = numpy .array ([4 , 5 , 6 , 7 , 8 , 9 , 10 ])
1211 thresholds = [5 , 7 , 9 ]
1312 choices = [10 , 15 , 20 , 25 ]
@@ -17,9 +16,8 @@ def test_apply_thresholds_when_several_inputs():
1716 assert_array_equal (result , [10 , 10 , 15 , 15 , 20 , 20 , 25 ])
1817
1918
20- def test_apply_thresholds_when_too_many_thresholds ():
19+ def test_apply_thresholds_when_too_many_thresholds () -> None :
2120 """Raises an AssertionError when thresholds > choices."""
22-
2321 input_ = numpy .array ([6 ])
2422 thresholds = [5 , 7 , 9 , 11 ]
2523 choices = [10 , 15 , 20 ]
@@ -28,9 +26,8 @@ def test_apply_thresholds_when_too_many_thresholds():
2826 assert commons .apply_thresholds (input_ , thresholds , choices )
2927
3028
31- def test_apply_thresholds_when_too_many_choices ():
29+ def test_apply_thresholds_when_too_many_choices () -> None :
3230 """Raises an AssertionError when thresholds < choices - 1."""
33-
3431 input_ = numpy .array ([6 ])
3532 thresholds = [5 , 7 ]
3633 choices = [10 , 15 , 20 , 25 ]
@@ -39,9 +36,8 @@ def test_apply_thresholds_when_too_many_choices():
3936 assert commons .apply_thresholds (input_ , thresholds , choices )
4037
4138
42- def test_concat_when_this_is_array_not_str ():
39+ def test_concat_when_this_is_array_not_str () -> None :
4340 """Casts ``this`` to ``str`` when it is a NumPy array other than string."""
44-
4541 this = numpy .array ([1 , 2 ])
4642 that = numpy .array (["la" , "o" ])
4743
@@ -50,9 +46,8 @@ def test_concat_when_this_is_array_not_str():
5046 assert_array_equal (result , ["1la" , "2o" ])
5147
5248
53- def test_concat_when_that_is_array_not_str ():
49+ def test_concat_when_that_is_array_not_str () -> None :
5450 """Casts ``that`` to ``str`` when it is a NumPy array other than string."""
55-
5651 this = numpy .array (["ho" , "cha" ])
5752 that = numpy .array ([1 , 2 ])
5853
@@ -61,19 +56,17 @@ def test_concat_when_that_is_array_not_str():
6156 assert_array_equal (result , ["ho1" , "cha2" ])
6257
6358
64- def test_concat_when_args_not_str_array_like ():
59+ def test_concat_when_args_not_str_array_like () -> None :
6560 """Raises a TypeError when args are not a string array-like object."""
66-
6761 this = (1 , 2 )
6862 that = (3 , 4 )
6963
7064 with pytest .raises (TypeError ):
7165 commons .concat (this , that )
7266
7367
74- def test_switch_when_values_are_empty ():
68+ def test_switch_when_values_are_empty () -> None :
7569 """Raises an AssertionError when the values are empty."""
76-
7770 conditions = [1 , 1 , 1 , 2 ]
7871 value_by_condition = {}
7972
0 commit comments