Skip to content

Commit

Permalink
skip
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgsavage committed May 15, 2024
1 parent 276d733 commit 45d623c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pint/testsuite/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
from pint.testsuite.test_umath import TestUFuncs


def requires_numpy_2(reason=None):
if reason is None:
reason = "requires numpy >= 2"
return pytest.mark.skipif(
np.lib.NumpyVersion(np.__version__) < "2.0.0b1", reason=reason
)


@helpers.requires_numpy
class TestNumpyMethods:
@classmethod
Expand Down Expand Up @@ -448,10 +456,7 @@ def test_trapz(self):

@helpers.requires_array_function_protocol()
# NP2: Remove this when we only support np>=2.0
@pytest.mark.skipif(
np.lib.NumpyVersion(np.__version__) < "2.0.0b1",
reason="trapezoid added in numpy2",
)
@requires_numpy_2(reason="trapezoid added in numpy2")
def test_trapezoid(self):
helpers.assert_quantity_equal(
np.trapezoid([1.0, 2.0, 3.0, 4.0] * self.ureg.J, dx=1 * self.ureg.m),
Expand Down

0 comments on commit 45d623c

Please sign in to comment.