Skip to content

Commit e461734

Browse files
Merge pull request #471 from adamtheturtle/fix-coverage
Remove uncovered code [skip ci]
2 parents 146205e + c8fd41e commit e461734

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/mock_vws/utils/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)