photutils
photutils copied to clipboard
Decorate all doc examples with pytest-mpl
Change all the doctest-skip
of the images, and also change the plot tests to check for the content with pytest-mpl
.
I plan to do this in the next few weeks, thus assigning myself.
@bsipocz - just a word of advice - for the plot tests, I highly recommend reducing the default figsize
to a small value that is large enough that you can see what you are testing but no larger (to keep the size of the reference images from being too large). Usually, something like 3x3 inches will be large enough.
@astrofrog, @larrybradley - Would you prefer to store the plot reference images here in photutils/tests
or can I put them to https://github.com/astropy/photutils-datasets
and have that either as a test dependency or submodule or similar?
@bsipocz - as long as there are <10, just store them in the repository directly. The difficulty with storing them in an external repository is that you need the versions to match very precisely, and it's not worth the hassle.
(But it's good to make an effort to minimize the size of each plot by reducing the figure size)
I agree that it's better to have them in the repository directly if possible.
@astrofrog - There is a serious issue with this namely that the apertute classes are tested using the @pytest.mark.parametrize
decorator. But the decorator doesn't parametrize the argument of another decorator, so I cannot say:
@pytest.mark.skipif('not HAS_MATPLOTLIB')
@pytest.mark.parametrize(('aperture_class', 'params'), TEST_APERTURES)
@pytest.mark.mpl_image_compare(filename='{0}.png'.format(aperture_class), tolerance=1.5)
def test_aperture_plots(aperture_class, params):
Do you know a workaround for this, or should I do the test one by one for the apertures?
@bsipocz I'm not sure - could you open an issue in the pytest-mpl repo and I can take a look at it later this week?