proplot icon indicating copy to clipboard operation
proplot copied to clipboard

Add pytest-mpl image comparison tests and update CI workflow

Open lukelbd opened this issue 1 year ago • 0 comments

This will finally add robust image comparison testing to proplot using matplotlib/pytest-mpl.

Inside tests, I declare several functions developed from my own ad hoc jupyter notebook tests. These will be automatically detected + run by pytest, with image comparisons carried out by pytest-mpl. Further, inside tests/test_docs.py, I dynamically create testing functions from the rst-style python files in docs using jupytext, so that pytest-mpl can perform image comparisons on the documentation examples alongside the other testing files. So, the travis CI no longer compiles the documentation with make html -- instead, the existing readthedocs workflow does this, and it should also now be enabled for new pull requests (if not, will try to figure out soon). I also use a fork of pytest-mpl to support comparing arbitrary figures created by each testing function (i.e., without explicitly returning figure objects; see this branch).

This work was done quite a while ago -- has just been sitting on my machine. Would like to merge it this spring.

lukelbd avatar Mar 27 '23 00:03 lukelbd