File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -449,12 +449,14 @@ def make_image_file(
449449 """
450450 image_buffer = io .BytesIO ()
451451 image = Image .new (color_space , (width , height ))
452- if color_space != 'L' :
453- reds = random .choices (population = range (0 , 255 ), k = width * height )
454- greens = random .choices (population = range (0 , 255 ), k = width * height )
455- blues = random .choices (population = range (0 , 255 ), k = width * height )
456- pixels = list (zip (reds , greens , blues ))
457- image .putdata (pixels )
452+ # If this assertion ever fails, see
453+ # https://github.com/adamtheturtle/vws-test-fixtures for what to do.
454+ assert color_space != 'L'
455+ reds = random .choices (population = range (0 , 255 ), k = width * height )
456+ greens = random .choices (population = range (0 , 255 ), k = width * height )
457+ blues = random .choices (population = range (0 , 255 ), k = width * height )
458+ pixels = list (zip (reds , greens , blues ))
459+ image .putdata (pixels )
458460 image .save (image_buffer , file_format )
459461 image_buffer .seek (0 )
460462 return image_buffer
You can’t perform that action at this time.
0 commit comments