Skip to content

Commit 86cfcad

Browse files
committed
Merge pull request #698 from bsipocz/deprecation_warnings_as_exceptions
Deprecation warnings as exceptions
2 parents e46514d + b0952e0 commit 86cfcad

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

astroquery/alma/tests/test_alma_utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Licensed under a 3-clause BSD style license - see LICENSE.rst
22
import numpy as np
3+
import warnings
4+
35
from astropy import wcs
46
from astropy import units as u
57
from astropy.tests.helper import pytest, remote_data
@@ -24,7 +26,11 @@ def test_pyregion_subset():
2426
shape.coord_list = (0.1, 0.1, 10. / 3600.)
2527
shape.attr = ([], {})
2628
data = np.ones([40, 40])
27-
(xlo, xhi, ylo, yhi), d = utils.pyregion_subset(shape, data, mywcs)
29+
30+
# The following line raises a DeprecationWarning from pyregion, ignore it
31+
with warnings.catch_warnings():
32+
warnings.filterwarnings('ignore')
33+
(xlo, xhi, ylo, yhi), d = utils.pyregion_subset(shape, data, mywcs)
2834

2935
# sticky note over check-engine light solution... but this problem is too
3036
# large in scope to address here. See
@@ -38,7 +44,6 @@ def test_pyregion_subset():
3844
data.shape[1] / 2 - mywcs.wcs.crpix[1] - 1)
3945
np.testing.assert_almost_equal(yhi,
4046
data.shape[1] - mywcs.wcs.crpix[1] - 1)
41-
4247
frq_sup_str = ('[86.26..88.14GHz,976.56kHz, XX YY] U '
4348
'[88.15..90.03GHz,976.56kHz, XX YY] U '
4449
'[98.19..100.07GHz,976.56kHz, XX YY] U '

astroquery/conftest.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
except (NameError, KeyError):
2626
pass
2727

28-
## Uncomment the following line to treat all DeprecationWarnings as
29-
## exceptions
30-
# enable_deprecations_as_exceptions()
28+
# Uncomment the following line to treat all DeprecationWarnings as
29+
# exceptions
30+
enable_deprecations_as_exceptions()
3131

3232

3333
# This is to figure out the affiliated package version, rather than

0 commit comments

Comments
 (0)