Open weiji14 opened 4 years ago
@weiji14 It looks like Option 2 at over your pytest-mpl pull request is the same syntax as what we currently use for @check_figures_equal
. Assuming your pull request is merged, would the only real change for PyGMT tests be different import statements to use the decorator?
Currently, check_figures_equal
is only used in the test_grdimage.py
file (https://github.com/search?q=repo%3AGenericMappingTools%2Fpygmt%20check_figures_equal&type=code). I'm wondering if we can fully get rid of check_figures_equal
and always use mpl_image_compare
instead.
I would probably keep check_figures_equal
until we fix https://github.com/GenericMappingTools/pygmt/issues/390, and can be confident that plotting from a NetCDF file vs an xarray.DataArray
is always the same.
Description of the desired feature
This is a medium to long term maintenance issue with the
check_figures_equal
function atpygmt/helpers/testing.py
, which is pretty much an exact copy of matplotlib'scheck_figures_equal
function. Ideally, we would just use a vendored function frommatplotlib
orpytest-mpl
instead of writing our own.Are you willing to help implement and maintain this feature? Yes, PR in the works at https://github.com/matplotlib/pytest-mpl/pull/95.