Skip to content

Commit a0a635b

Browse files
committed
MAINT: some deprecation consistency cleanup
1 parent 4617173 commit a0a635b

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

astroquery/cds/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121
# Licensed under a 3-clause BSD style license - see LICENSE.rst
2222
import warnings
23+
from astropy.utils.exceptions import AstropyDeprecationWarning
24+
2325

2426
warnings.warn("The ``cds`` module has been moved to astroquery.mocserver, "
2527
"and ``CdsClass`` has been renamed to ``MOCServerClass``. "
26-
"Please update your imports.", DeprecationWarning, stacklevel=2)
28+
"Please update your imports.", AstropyDeprecationWarning, stacklevel=2)
2729

2830
from astroquery.mocserver import MOCServer as cds
2931
from astroquery.mocserver import MOCServerClass as CdsClass

astroquery/mocserver/tests/test_deprecation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import pytest
2+
from astropy.utils.exceptions import AstropyDeprecationWarning
23

34

45
def test_raises_deprecation_warning():
56
with pytest.raises(
6-
DeprecationWarning,
7+
AstropyDeprecationWarning,
78
match="The ``cds`` module has been moved to astroquery.mocserver, "
89
"and ``CdsClass`` has been renamed to ``MOCServerClass``. "
910
"Please update your imports."):

setup.cfg

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ filterwarnings =
5858
ignore:Experimental. Fermi-LAT:UserWarning
5959
ignore:Experimental. SHA:UserWarning
6060
ignore:Experimental. OGLE:UserWarning:
61-
# Warnings from deprecated or known-to-be-broken modules
62-
ignore:The legacy NRAO archive this module uses has been retired:UserWarning
61+
# Warnings from deprecated or known-to-be-broken modules. They have to be listed to make test collection work,
62+
# Can be removed once the modules are removed.
6363
ignore:vamdclib could not be imported; the vamdc astroquery module will not work:UserWarning
6464
ignore:the vamdc astroquery module:astropy.utils.exceptions.AstropyDeprecationWarning
6565
# Leap second update related warning
6666
ignore:leap-second auto-update failed:astropy.utils.exceptions.AstropyWarning
67+
68+
6769
# Should ignore these for astropy<5.0
6870
ignore:getName|currentThread:DeprecationWarning:astropy
6971
markers =

0 commit comments

Comments
 (0)