Skip to content

Commit

Permalink
use pytest skip for numpy2 test trapezoid (#1988)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewgsavage authored May 15, 2024
1 parent 21ad66c commit 8eb3e31
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions pint/testsuite/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,13 +447,14 @@ def test_trapz(self):
)

@helpers.requires_array_function_protocol()
# NP2: Remove this when we only support np>=2.0
# trapezoid added in numpy 2.0
@helpers.requires_numpy_at_least("2.0")
def test_trapezoid(self):
# NP2: Remove this when we only support np>=2.0
if np.lib.NumpyVersion(np.__version__) >= "2.0.0b1":
helpers.assert_quantity_equal(
np.trapezoid([1.0, 2.0, 3.0, 4.0] * self.ureg.J, dx=1 * self.ureg.m),
7.5 * self.ureg.J * self.ureg.m,
)
helpers.assert_quantity_equal(
np.trapezoid([1.0, 2.0, 3.0, 4.0] * self.ureg.J, dx=1 * self.ureg.m),
7.5 * self.ureg.J * self.ureg.m,
)

@helpers.requires_array_function_protocol()
def test_dot(self):
Expand Down

0 comments on commit 8eb3e31

Please sign in to comment.