From 270dc3301b3ddf3516a984ba0304df728b3617c0 Mon Sep 17 00:00:00 2001 From: Richard R <58728519+rrjbca@users.noreply.github.com> Date: Mon, 23 May 2022 07:57:33 +0100 Subject: [PATCH] TST: Drop deprecated astropy.tests.helper.raises (#546) --- skypy/utils/tests/test_special.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/skypy/utils/tests/test_special.py b/skypy/utils/tests/test_special.py index 565e70d93..92b7f101c 100644 --- a/skypy/utils/tests/test_special.py +++ b/skypy/utils/tests/test_special.py @@ -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 @@ -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])