pytest-mpl 0.17.1.dev3+gdf9e593 documentation#

pytest-mpl is a pytest plugin to facilitate image comparison for Matplotlib figures.

For each figure to test, an image is generated and then subtracted from an existing reference image. If the RMS of the residual is larger than a user-specified tolerance, the test will fail. Alternatively, the generated image can be hashed and compared to an expected value.


Install using pip:

pip install pytest-mpl

Install from conda-forge using conda:

conda install pytest-mpl

Further details are available in the Installation Guide.

Learning resources#


Understand how pytest-mpl works

Explanatory information is included where relevant throughout the documentation.



pytest-mpl is a community project maintained for and by its users. There are many ways you can help!

  • Report a bug or request a feature on GitHub

  • Improve the documentation or code