Skip to content

Commit

Permalink
skip matplotlib tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joleroi committed Mar 25, 2016
1 parent 95d09cc commit 7a2f152
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion regions/shapes/tests/test_circle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.tests.helper import pytest
from astropy.utils.data import get_pkg_data_filename
from astropy.io.fits import getheader
from astropy.wcs import WCS
Expand All @@ -8,6 +9,12 @@
from ..circle import CirclePixelRegion, CircleSkyRegion
from ...core import PixCoord

try:
import matplotlib
HAS_MATPLOTLIB = True
except:
HAS_MATPLOTLIB = False


def test_init_pixel():
pixcoord = PixCoord(3, 4)
Expand All @@ -19,6 +26,7 @@ def test_init_sky():


# Todo : restructure test to use same circle everywhere
@pytest.mark.skipif('not HAS_MATPLOTLIB')
def test_plot():
import matplotlib.pyplot as plt

Expand All @@ -34,4 +42,4 @@ def test_plot():

assert_allclose(p.center[0], skycoord.icrs.ra.value)
assert_allclose(p.center[1], skycoord.icrs.dec.value)
assert p.get_facecolor() == (1, 0, 0, 0.6)
assert p.get_facecolor() == (1, 0, 0, 0.6)

0 comments on commit 7a2f152

Please sign in to comment.