16
16
# fmt: on
17
17
18
18
19
- def test_imageops_box_blur ():
19
+ def test_imageops_box_blur () -> None :
20
20
i = sample .filter (ImageFilter .BoxBlur (1 ))
21
21
assert i .mode == sample .mode
22
22
assert i .size == sample .size
23
23
assert isinstance (i , Image .Image )
24
24
25
25
26
- def box_blur (image , radius = 1 , n = 1 ):
26
+ def box_blur (image , radius : int = 1 , n : int = 1 ):
27
27
return image ._new (image .im .box_blur ((radius , radius ), n ))
28
28
29
29
30
- def assert_image (im , data , delta = 0 ) :
30
+ def assert_image (im , data , delta : int = 0 ) -> None :
31
31
it = iter (im .getdata ())
32
32
for data_row in data :
33
33
im_row = [next (it ) for _ in range (im .size [0 ])]
@@ -37,15 +37,15 @@ def assert_image(im, data, delta=0):
37
37
next (it )
38
38
39
39
40
- def assert_blur (im , radius , data , passes = 1 , delta = 0 ) :
40
+ def assert_blur (im , radius , data , passes : int = 1 , delta : int = 0 ) -> None :
41
41
# check grayscale image
42
42
assert_image (box_blur (im , radius , passes ), data , delta )
43
43
rgba = Image .merge ("RGBA" , (im , im , im , im ))
44
44
for band in box_blur (rgba , radius , passes ).split ():
45
45
assert_image (band , data , delta )
46
46
47
47
48
- def test_color_modes ():
48
+ def test_color_modes () -> None :
49
49
with pytest .raises (ValueError ):
50
50
box_blur (sample .convert ("1" ))
51
51
with pytest .raises (ValueError ):
@@ -65,7 +65,7 @@ def test_color_modes():
65
65
box_blur (sample .convert ("YCbCr" ))
66
66
67
67
68
- def test_radius_0 ():
68
+ def test_radius_0 () -> None :
69
69
assert_blur (
70
70
sample ,
71
71
0 ,
@@ -81,7 +81,7 @@ def test_radius_0():
81
81
)
82
82
83
83
84
- def test_radius_0_02 ():
84
+ def test_radius_0_02 () -> None :
85
85
assert_blur (
86
86
sample ,
87
87
0.02 ,
@@ -98,7 +98,7 @@ def test_radius_0_02():
98
98
)
99
99
100
100
101
- def test_radius_0_05 ():
101
+ def test_radius_0_05 () -> None :
102
102
assert_blur (
103
103
sample ,
104
104
0.05 ,
@@ -115,7 +115,7 @@ def test_radius_0_05():
115
115
)
116
116
117
117
118
- def test_radius_0_1 ():
118
+ def test_radius_0_1 () -> None :
119
119
assert_blur (
120
120
sample ,
121
121
0.1 ,
@@ -132,7 +132,7 @@ def test_radius_0_1():
132
132
)
133
133
134
134
135
- def test_radius_0_5 ():
135
+ def test_radius_0_5 () -> None :
136
136
assert_blur (
137
137
sample ,
138
138
0.5 ,
@@ -149,7 +149,7 @@ def test_radius_0_5():
149
149
)
150
150
151
151
152
- def test_radius_1 ():
152
+ def test_radius_1 () -> None :
153
153
assert_blur (
154
154
sample ,
155
155
1 ,
@@ -166,7 +166,7 @@ def test_radius_1():
166
166
)
167
167
168
168
169
- def test_radius_1_5 ():
169
+ def test_radius_1_5 () -> None :
170
170
assert_blur (
171
171
sample ,
172
172
1.5 ,
@@ -183,7 +183,7 @@ def test_radius_1_5():
183
183
)
184
184
185
185
186
- def test_radius_bigger_then_half ():
186
+ def test_radius_bigger_then_half () -> None :
187
187
assert_blur (
188
188
sample ,
189
189
3 ,
@@ -200,7 +200,7 @@ def test_radius_bigger_then_half():
200
200
)
201
201
202
202
203
- def test_radius_bigger_then_width ():
203
+ def test_radius_bigger_then_width () -> None :
204
204
assert_blur (
205
205
sample ,
206
206
10 ,
@@ -215,7 +215,7 @@ def test_radius_bigger_then_width():
215
215
)
216
216
217
217
218
- def test_extreme_large_radius ():
218
+ def test_extreme_large_radius () -> None :
219
219
assert_blur (
220
220
sample ,
221
221
600 ,
@@ -230,7 +230,7 @@ def test_extreme_large_radius():
230
230
)
231
231
232
232
233
- def test_two_passes ():
233
+ def test_two_passes () -> None :
234
234
assert_blur (
235
235
sample ,
236
236
1 ,
@@ -248,7 +248,7 @@ def test_two_passes():
248
248
)
249
249
250
250
251
- def test_three_passes ():
251
+ def test_three_passes () -> None :
252
252
assert_blur (
253
253
sample ,
254
254
1 ,
0 commit comments