Skip to content

Commit bf5e26d

Browse files
wtgeepllim
andauthored
Remove deprecated call to astropy helpers. (#554)
* Remove deprecated call to astropy helpers. Closes #553 * Add the warnings-as-errors functionality via pytest options. --------- Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
1 parent b04135b commit bf5e26d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

astroplan/tests/test_constraints.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ def test_galactic_plane_separation():
174174

175175
# in astropy before v1.0.4, a recursion error is triggered by this test
176176
@pytest.mark.skipif('APY_LT104')
177+
# astropy.coordinates.errors.NonRotationTransformationWarning
178+
@pytest.mark.filterwarnings("ignore")
177179
def test_sun_separation():
178180
time = Time('2003-04-05 06:07:08')
179181
apo = Observer.at_site("APO")
@@ -198,6 +200,8 @@ def test_sun_separation():
198200
assert np.all(is_constraint_met == [False, True, True])
199201

200202

203+
# astropy.coordinates.errors.NonRotationTransformationWarning
204+
@pytest.mark.filterwarnings("ignore")
201205
def test_moon_separation():
202206
time = Time('2003-04-05 06:07:08')
203207
apo = Observer.at_site("APO")
@@ -423,6 +427,8 @@ def test_rescale_minmax():
423427

424428

425429
@pytest.mark.parametrize('constraint', constraint_tests)
430+
# astropy.coordinates.errors.NonRotationTransformationWarning
431+
@pytest.mark.filterwarnings("ignore")
426432
def test_regression_shapes(constraint):
427433
times = Time(["2015-08-28 03:30", "2015-09-05 10:30", "2015-09-15 18:35"])
428434
targets = get_skycoord([FixedTarget(SkyCoord(350.7*u.deg, 18.4*u.deg)),

setup.cfg

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ doctest_plus = enabled
4747
text_file_format = rst
4848
addopts = --doctest-rst --doctest-ignore-import-errors
4949
norecursedirs = build docs/_build
50+
filterwarnings =
51+
error
52+
ignore:numpy\.ndarray size changed:RuntimeWarning
53+
ignore:numpy\.ufunc size changed:RuntimeWarning
54+
# Can remove ignore when you bump astropy minversion high enough
55+
ignore:distutils Version classes are deprecated:DeprecationWarning
56+
# deprecated in Matplotlib 3.9 and will be removed in 3.11. Use plot instead.
57+
ignore:The plot_date function was deprecated
5058

5159
[coverage:run]
5260
omit =
@@ -88,4 +96,3 @@ max-line-length = 100
8896
[pycodestyle]
8997
exclude = _astropy_init.py,extern,__init__.py
9098
max-line-length = 100
91-

0 commit comments

Comments
 (0)