From 8eb3e31919142e5e204ef8d3dbaf19334886abb0 Mon Sep 17 00:00:00 2001 From: andrewgsavage Date: Wed, 15 May 2024 22:01:44 +0100 Subject: [PATCH] use pytest skip for numpy2 test trapezoid (#1988) --- pint/testsuite/test_numpy.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pint/testsuite/test_numpy.py b/pint/testsuite/test_numpy.py index 486102124..3075be7ac 100644 --- a/pint/testsuite/test_numpy.py +++ b/pint/testsuite/test_numpy.py @@ -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):