Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Drop deprecated astropy.tests.helper.raises #546

Merged
merged 2 commits into from
May 23, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions skypy/utils/tests/test_special.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import numpy as np
import numpy.testing as npt
from astropy.utils.data import get_pkg_data_filename
from astropy.tests.helper import raises
import pytest

from skypy.utils.special import gammaincc

Expand Down Expand Up @@ -80,13 +80,13 @@ def test_gammaincc_precision():
npt.assert_allclose(g, v, rtol=1e-10, atol=0, err_msg='\n'.join(lines))


@raises(ValueError)
def test_gammaincc_neg_x_scalar():
# negative x raises an exception
gammaincc(0.5, -1.0)
with pytest.raises(ValueError):
gammaincc(0.5, -1.0)


@raises(ValueError)
def test_gammaincc_neg_x_array():
# negative x in array raises an exception
gammaincc(0.5, [3.0, 2.0, 1.0, 0.0, -1.0])
with pytest.raises(ValueError):
gammaincc(0.5, [3.0, 2.0, 1.0, 0.0, -1.0])