A pytest fixture for image similarity

When testing codepaths that generate images, one might want to ensure that the generated image is what is expected. Matplotlib has a nice decorator @image_comparison that can be applied for this purpose, but looking at the implementation, it’s pretty tied to the matplotlib Figure object.