Skip to content

Commit a12c06f

Browse files
committed
Merge pull request #549 from keflavich/issue549
pyregion import in tests
2 parents 1fad2da + fcaefeb commit a12c06f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

astroquery/alma/tests/test_alma_utils.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22
import numpy as np
33
from astropy import wcs
44
from astropy import units as u
5-
from pyregion.parser_helper import Shape
65
from astropy.tests.helper import pytest, remote_data
6+
try:
7+
from pyregion.parser_helper import Shape
8+
pyregion_OK = True
9+
except ImportError:
10+
pyregion_OK = False
711

812
from .. import utils
913

14+
@pytest.mark.skipif('not pyregion_OK')
1015
def test_pyregion_subset():
1116
header = dict(naxis=2, crpix1=15, crpix2=15, crval1=0.1, crval2=0.1,
1217
cdelt1=-1./3600, cdelt2=1./3600., ctype1='GLON-CAR',
@@ -39,8 +44,9 @@ def test_parse_frequency_support(frq_sup_str=frq_sup_str, result=franges):
3944

4045
def approximate_primary_beam_sizes(frq_sup_str=frq_sup_str, beamsizes=beamsizes):
4146
assert np.all(utils.approximate_primary_beam_sizes(frq_sup_str) == beamsizes)
42-
47+
4348
@remote_data
49+
@pytest.mark.skipif('not pyregion_OK')
4450
def test_make_finder_chart():
4551
result = utils.make_finder_chart('Eta Carinae', 3*u.arcmin, 'Eta Carinae')
4652
images, catalog, hit_mask_public, hit_mask_private = result

0 commit comments

Comments
 (0)