change this: assert imread(image).shape[2] == 3 for this: assert imread(image)[2].shape == 3
change this:
assert imread(image).shape[2] == 3
for this:
assert imread(image)[2].shape == 3