Skip to content

Commit 41c2cab

Browse files
committed
TST: fix up tests to deal with UnitsWarning coming from older astropy
1 parent 49d40d4 commit 41c2cab

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

astroquery/imcce/tests/test_miriade.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ def patch_request(request):
4040

4141
# --------------------------------- actual test functions
4242

43+
# Older astropy versions issues UnitsWarnings for "u.au", we need to ignore those here. Revisit when we drop __version__ 5.0
44+
# WARNING: UnitsWarning: The unit 'au' has been deprecated in the VOUnit standard. Suggested: 1.4959787e+11m. [astropy.units.format.utils]
4345

46+
@pytest.mark.filterwarnings("ignore::astropy.units.UnitsWarning")
4447
def test_spherical_coordinates(patch_request):
4548
eph = Miriade.get_ephemerides('3552', coordtype=1)
4649
cols = ('epoch', 'RA', 'DEC', 'delta', 'V', 'alpha', 'elong', 'RAcosD_rate',
@@ -53,6 +56,7 @@ def test_spherical_coordinates(patch_request):
5356
assert eph[cols[i]].unit == units[i]
5457

5558

59+
@pytest.mark.filterwarnings("ignore::astropy.units.UnitsWarning")
5660
def test_spherical_coordinates_ecliptic(patch_request):
5761
eph = Miriade.get_ephemerides('3552', coordtype=1, refplane="ecliptic")
5862
cols = ('epoch', 'LONG', 'LAT', 'delta', 'V', 'alpha', 'elong', 'LONGcosLAT_rate',
@@ -65,6 +69,7 @@ def test_spherical_coordinates_ecliptic(patch_request):
6569
assert eph[cols[i]].unit == units[i]
6670

6771

72+
@pytest.mark.filterwarnings("ignore::astropy.units.UnitsWarning")
6873
def test_rectangular_coordinates(patch_request):
6974
eph = Miriade.get_ephemerides('3552', coordtype=2)
7075
cols = ('epoch', 'px', 'py', 'pz', 'delta', 'heldist', 'alpha', 'elong', 'V',
@@ -77,6 +82,7 @@ def test_rectangular_coordinates(patch_request):
7782
assert eph[cols[i]].unit == units[i]
7883

7984

85+
@pytest.mark.filterwarnings("ignore::astropy.units.UnitsWarning")
8086
def test_local_coordinates(patch_request):
8187
eph = Miriade.get_ephemerides('3552', coordtype=3)
8288
cols = ('epoch', 'siderealtime', 'AZ', 'EL', 'delta', 'V',
@@ -89,6 +95,7 @@ def test_local_coordinates(patch_request):
8995
assert eph[cols[i]].unit == units[i]
9096

9197

98+
@pytest.mark.filterwarnings("ignore::astropy.units.UnitsWarning")
9299
def test_hourangle_coordinates(patch_request):
93100
eph = Miriade.get_ephemerides('3552', coordtype=4)
94101
cols = ['epoch', 'siderealtime', 'hourangle', 'dec', 'delta', 'V',
@@ -101,6 +108,7 @@ def test_hourangle_coordinates(patch_request):
101108
assert eph[cols[i]].unit == units[i]
102109

103110

111+
@pytest.mark.filterwarnings("ignore::astropy.units.UnitsWarning")
104112
def test_observation_coordinates(patch_request):
105113
eph = Miriade.get_ephemerides('3552', coordtype=5)
106114
cols = ['epoch', 'siderealtime', 'RA', 'DEC', 'hourangle', 'AZ', 'EL',

0 commit comments

Comments
 (0)