@@ -209,7 +209,7 @@ def test_optimize_if_palette_can_be_reduced_by_half():
209209 im = im .resize ((591 , 443 ))
210210 im_rgb = im .convert ("RGB" )
211211
212- for ( optimize , colors ) in ((False , 256 ), (True , 8 )):
212+ for optimize , colors in ((False , 256 ), (True , 8 )):
213213 out = BytesIO ()
214214 im_rgb .save (out , "GIF" , optimize = optimize )
215215 with Image .open (out ) as reloaded :
@@ -221,7 +221,6 @@ def test_roundtrip(tmp_path):
221221 im = hopper ()
222222 im .save (out )
223223 with Image .open (out ) as reread :
224-
225224 assert_image_similar (reread .convert ("RGB" ), im , 50 )
226225
227226
@@ -232,7 +231,6 @@ def test_roundtrip2(tmp_path):
232231 im2 = im .copy ()
233232 im2 .save (out )
234233 with Image .open (out ) as reread :
235-
236234 assert_image_similar (reread .convert ("RGB" ), hopper (), 50 )
237235
238236
@@ -242,7 +240,6 @@ def test_roundtrip_save_all(tmp_path):
242240 im = hopper ()
243241 im .save (out , save_all = True )
244242 with Image .open (out ) as reread :
245-
246243 assert_image_similar (reread .convert ("RGB" ), im , 50 )
247244
248245 # Multiframe image
@@ -284,13 +281,11 @@ def test_headers_saving_for_animated_gifs(tmp_path):
284281 important_headers = ["background" , "version" , "duration" , "loop" ]
285282 # Multiframe image
286283 with Image .open ("Tests/images/dispose_bgnd.gif" ) as im :
287-
288284 info = im .info .copy ()
289285
290286 out = str (tmp_path / "temp.gif" )
291287 im .save (out , save_all = True )
292288 with Image .open (out ) as reread :
293-
294289 for header in important_headers :
295290 assert info [header ] == reread .info [header ]
296291
@@ -308,7 +303,6 @@ def test_palette_handling(tmp_path):
308303 im2 .save (f , optimize = True )
309304
310305 with Image .open (f ) as reloaded :
311-
312306 assert_image_similar (im , reloaded .convert ("RGB" ), 10 )
313307
314308
@@ -324,7 +318,6 @@ def roundtrip(im, *args, **kwargs):
324318
325319 orig = "Tests/images/test.colors.gif"
326320 with Image .open (orig ) as im :
327-
328321 with roundtrip (im ) as reloaded :
329322 assert_image_similar (im , reloaded , 1 )
330323 with roundtrip (im , optimize = True ) as reloaded :
@@ -575,7 +568,6 @@ def test_save_dispose(tmp_path):
575568 )
576569
577570 with Image .open (out ) as img :
578-
579571 for i in range (2 ):
580572 img .seek (img .tell () + 1 )
581573 assert img .disposal_method == i + 1
@@ -773,7 +765,6 @@ def test_multiple_duration(tmp_path):
773765 out , save_all = True , append_images = im_list [1 :], duration = duration_list
774766 )
775767 with Image .open (out ) as reread :
776-
777768 for duration in duration_list :
778769 assert reread .info ["duration" ] == duration
779770 try :
@@ -786,7 +777,6 @@ def test_multiple_duration(tmp_path):
786777 out , save_all = True , append_images = im_list [1 :], duration = tuple (duration_list )
787778 )
788779 with Image .open (out ) as reread :
789-
790780 for duration in duration_list :
791781 assert reread .info ["duration" ] == duration
792782 try :
@@ -844,7 +834,6 @@ def test_identical_frames(tmp_path):
844834 out , save_all = True , append_images = im_list [1 :], duration = duration_list
845835 )
846836 with Image .open (out ) as reread :
847-
848837 # Assert that the first three frames were combined
849838 assert reread .n_frames == 2
850839
0 commit comments