11
11
12
12
try :
13
13
from mocpy import MOC
14
+ HAS_MOCPY = True
14
15
except ImportError :
15
- pass
16
+ HAS_MOCPY = False
16
17
17
18
try :
18
19
from regions import CircleSkyRegion , PolygonSkyRegion
20
+ HAS_REGIONS = True
19
21
except ImportError :
20
- pass
22
+ HAS_REGIONS = False
21
23
22
24
from ..core import cds
23
25
from ...utils .testing_tools import MockResponse
@@ -72,8 +74,8 @@ def data_path(filename):
72
74
"""
73
75
74
76
75
- @pytest .mark .skipif ('regions' not in sys . modules ,
76
- reason = "requires astropy-regions" )
77
+ @pytest .mark .skipif ('not HAS_REGIONS' )
78
+ @ pytest . mark . skipif ( 'not HAS_MOCPY' )
77
79
@pytest .mark .parametrize ('datafile' ,
78
80
['PROPERTIES_SEARCH' , 'HIPS_FROM_SAADA_AND_ALASKY' ])
79
81
def test_request_results (patch_get , datafile ):
@@ -97,8 +99,8 @@ def test_request_results(patch_get, datafile):
97
99
"""
98
100
99
101
100
- @pytest .mark .skipif ('regions' not in sys . modules ,
101
- reason = "requires astropy-regions" )
102
+ @pytest .mark .skipif ('not HAS_REGIONS' )
103
+ @ pytest . mark . skipif ( 'not HAS_MOCPY' )
102
104
@pytest .mark .parametrize ('RA, DEC, RADIUS' ,
103
105
[(10.8 , 6.5 , 0.5 ),
104
106
(25.6 , - 23.2 , 1.1 ),
@@ -117,8 +119,8 @@ def test_cone_search_spatial_request(RA, DEC, RADIUS):
117
119
(request_payload ['SR' ] == str (RADIUS ))
118
120
119
121
120
- @pytest .mark .skipif ('regions' not in sys . modules ,
121
- reason = "requires astropy-regions" )
122
+ @pytest .mark .skipif ('not HAS_REGIONS' )
123
+ @ pytest . mark . skipif ( 'not HAS_MOCPY' )
122
124
@pytest .mark .parametrize ('poly, poly_payload' ,
123
125
[(polygon1 , 'Polygon 57.376 24.053 56.391 24.622 56.025 24.049 56.616 24.291' ),
124
126
(polygon2 , 'Polygon 58.376 24.053 53.391 25.622 56.025 22.049 54.616 27.291' )])
@@ -132,8 +134,8 @@ def test_polygon_spatial_request(poly, poly_payload):
132
134
assert request_payload ['stc' ] == poly_payload
133
135
134
136
135
- @pytest .mark .skipif ('regions' not in sys . modules ,
136
- reason = "requires astropy-regions" )
137
+ @pytest .mark .skipif ('not HAS_REGIONS' )
138
+ @ pytest . mark . skipif ( 'not HAS_MOCPY' )
137
139
@pytest .mark .parametrize ('intersect' ,
138
140
['encloses' , 'overlaps' , 'covers' ])
139
141
def test_intersect_param (intersect ):
0 commit comments