Add image comparison tests #553
ecomodeller
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
Currently, plot tests mainly verify that functions return objects, not their visual correctness. There's only one image comparison test (for wind rose) which uses
pixel-by-pixel comparison and is acknowledged as fragile in a TODO comment.
This means refactoring plotting code could introduce visual regressions that go undetected.
Proposal
Add visual regression testing using pytest-mpl, the standard tool for matplotlib image comparison in scientific Python.
Why pytest-mpl over alternatives like ApprovalTests?
Example test
Plot types to cover
Other plot types are less crucial.
Considerations
--mpl-generate-pathBeta Was this translation helpful? Give feedback.
All reactions