redshiftzero
  • Categories
  • Tags
  • About

A pytest fixture for image similarity

 2020.1.12  2025.2.10  Post/Software Development  291  2 mins

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. I wanted something generic to use with PNGs.

Read More »
  • < Newer
  • Older >
© 1969–2025 
Powered by Hugo | Theme is MemE
CC BY-NC-SA 4.0