Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Make sure that all images comparison tests are now marked with @remot…
Browse files Browse the repository at this point in the history
…e_data since the baseline directory is remote.
  • Loading branch information
astrofrog committed May 6, 2016
1 parent 61dcd3a commit beca029
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
6 changes: 5 additions & 1 deletion wcsaxes/tests/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import matplotlib.pyplot as plt

from astropy.wcs import WCS
from astropy.tests.helper import pytest
from astropy.tests.helper import pytest, remote_data

from .. import WCSAxes
from .. import datasets
Expand Down Expand Up @@ -35,6 +35,7 @@ def update_spines(self):

class TestFrame(BaseImageTests):

@remote_data
@pytest.mark.mpl_image_compare(filename='custom_frame.png', tolerance=1.5)
def test_custom_frame(self):

Expand Down Expand Up @@ -74,6 +75,7 @@ def test_custom_frame(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='update_clip_path_rectangular.png', tolerance=1.5)
def test_update_clip_path_rectangular(self, tmpdir):

Expand All @@ -95,6 +97,7 @@ def test_update_clip_path_rectangular(self, tmpdir):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='update_clip_path_nonrectangular.png', tolerance=1.5)
def test_update_clip_path_nonrectangular(self, tmpdir):

Expand All @@ -117,6 +120,7 @@ def test_update_clip_path_nonrectangular(self, tmpdir):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='update_clip_path_change_wcs.png', tolerance=1.5)
def test_update_clip_path_change_wcs(self, tmpdir):

Expand Down
22 changes: 17 additions & 5 deletions wcsaxes/tests/test_images.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os
import shutil
import tempfile

import numpy as np
import matplotlib.pyplot as plt
from matplotlib.testing.compare import compare_images
from matplotlib.patches import Circle

from astropy import units as u
from astropy.io import fits
from astropy.tests.helper import pytest
from astropy.tests.helper import remote_data
from astropy.tests.helper import pytest, remote_data
from astropy.wcs import WCS

from ..rc_utils import rc_context
Expand Down Expand Up @@ -44,6 +40,7 @@ def setup_class(cls):

class TestBasic(BaseImageTests):

@remote_data
@pytest.mark.mpl_image_compare(filename='image_plot.png', tolerance=1.5)
def test_image_plot(self):
# Test for plotting image and also setting values of ticks
Expand All @@ -54,6 +51,7 @@ def test_image_plot(self):
ax.coords[0].set_ticks([-0.30, 0., 0.20] * u.degree, size=5, width=1)
return fig

@remote_data
@remote_data
@pytest.mark.mpl_image_compare(filename='contour_overlay.png', tolerance=1.5)
def test_contour_overlay(self):
Expand All @@ -78,6 +76,7 @@ def test_contour_overlay(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='overlay_features_image.png', tolerance=1.5)
def test_overlay_features_image(self):

Expand Down Expand Up @@ -111,6 +110,7 @@ def test_overlay_features_image(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='curvlinear_grid_patches_image.png', tolerance=1.5)
def test_curvilinear_grid_patches_image(self):

Expand Down Expand Up @@ -142,6 +142,7 @@ def test_curvilinear_grid_patches_image(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='cube_slice_image.png', tolerance=1.5)
def test_cube_slice_image(self):

Expand All @@ -167,6 +168,7 @@ def test_cube_slice_image(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='cube_slice_image_lonlat.png', tolerance=1.5)
def test_cube_slice_image_lonlat(self):

Expand All @@ -186,6 +188,7 @@ def test_cube_slice_image_lonlat(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='changed_axis_units.png', tolerance=1.5)
def test_changed_axis_units(self):
# Test to see if changing the units of axis works
Expand All @@ -203,6 +206,7 @@ def test_changed_axis_units(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='minor_ticks_image.png', tolerance=1.5)
def test_minor_ticks(self):
# Test for drawing minor ticks
Expand All @@ -221,6 +225,7 @@ def test_minor_ticks(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='ticks_labels.png', tolerance=1.5)
def test_ticks_labels(self):
fig = plt.figure(figsize=(6, 6))
Expand Down Expand Up @@ -248,6 +253,7 @@ def test_ticks_labels(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='rcparams.png', tolerance=1.5)
def test_rcparams(self):
# Test default style (matplotlib.rcParams) for ticks and gridlines
Expand All @@ -269,6 +275,7 @@ def test_rcparams(self):
ax.coords[1].set_ticks(exclude_overlapping=True)
return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='tick_angles.png', tolerance=1.5)
def test_tick_angles(self):
# Test that tick marks point in the correct direction, even when the
Expand All @@ -289,6 +296,7 @@ def test_tick_angles(self):
ax.coords['dec'].set_ticks(color='red', size=20)
return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='tick_angles_non_square_axes.png', tolerance=1.5)
def test_tick_angles_non_square_axes(self):
# Test that tick marks point in the correct direction, even when the
Expand All @@ -310,6 +318,7 @@ def test_tick_angles_non_square_axes(self):
ax.coords['dec'].set_ticks(color='red', size=20)
return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='set_coord_type.png', tolerance=1.5)
def test_set_coord_type(self):
# Test for setting coord_type
Expand All @@ -327,6 +336,7 @@ def test_set_coord_type(self):
ax.coords[1].set_ticks(exclude_overlapping=True)
return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='test_ticks_regression_1.png', tolerance=1.5)
def test_ticks_regression(self):
# Regression test for a bug that caused ticks aligned exactly with a
Expand All @@ -349,6 +359,7 @@ def test_ticks_regression(self):
ax.coords[1].set_ticklabel_position('all')
return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='test_axislabels_regression.png', savefig_kwargs={'bbox_inches': 'tight'}, tolerance=1.5)
def test_axislabels_regression(self):
# Regression test for a bug that meant that if tick labels were made
Expand All @@ -363,6 +374,7 @@ def test_axislabels_regression(self):
ax.coords[1].ticklabels.set_visible(False)
return fig

@remote_data
@pytest.mark.mpl_image_compare(savefig_kwargs={'bbox_inches': 'tight'},
tolerance=1.5)
def test_noncelestial_angular(self, tmpdir):
Expand Down
5 changes: 4 additions & 1 deletion wcsaxes/tests/test_transform_coord_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import astropy
from astropy import units as u
from astropy.wcs import WCS
from astropy.tests.helper import pytest
from astropy.tests.helper import pytest, remote_data

from .. import WCSAxes
from .test_images import BaseImageTests
Expand Down Expand Up @@ -58,6 +58,7 @@ def inverted(self):

class TestTransformCoordMeta(BaseImageTests):

@remote_data
@pytest.mark.mpl_image_compare(filename='coords_overlay.png', tolerance=1.5)
def test_coords_overlay(self):

Expand Down Expand Up @@ -106,6 +107,7 @@ def test_coords_overlay(self):
return fig

@requires_astropy_10
@remote_data
@pytest.mark.mpl_image_compare(filename='coords_overlay_auto_coord_meta.png', tolerance=1.5)
def test_coords_overlay_auto_coord_meta(self):

Expand All @@ -128,6 +130,7 @@ def test_coords_overlay_auto_coord_meta(self):

return fig

@remote_data
@pytest.mark.mpl_image_compare(filename='direct_init.png', tolerance=1.5)
def test_direct_init(self):

Expand Down

0 comments on commit beca029

Please sign in to comment.