Energy-Visualizer / eviz

Energy Visualizer (Summer 2024)
0 stars 0 forks source link

Consider creating snapshot tests for visuals #37

Open rpruim opened 1 week ago

rpruim commented 1 week ago

Snapshot tests are a form of unit testing that can work well for graphical output. I've used them extensively for R packages like ggformula. Most of the functions in the package produce graphical output and R's testthat system supports snapshot tests and provides and easy to way to compare and approve/reject any time the graphic produced by a given test changes.

It looks like https://pypi.org/project/pytest-snapshot/ might provide something similar for Python. (Needs more investigation.)

These work primarily as regression tests (to make sure things don't break as you modify code), but they could also be used for things like #20 and #35 by not approving a snapshot until the plot has been verified as correct.