(self, name, request)
| 210 | @pytest.mark.filterwarnings("ignore::RuntimeWarning") |
| 211 | @pytest.mark.parametrize("name", xu.__all__) |
| 212 | def test_ufuncs(self, name, request): |
| 213 | xu_func = getattr(xu, name) |
| 214 | np_func = getattr(np, name, None) |
| 215 | if np_func is None and np.lib.NumpyVersion(np.__version__) < "2.0.0": |
| 216 | pytest.skip(f"Ufunc {name} is not available in numpy {np.__version__}.") |
| 217 | |
| 218 | if name == "isnat": |
| 219 | args = (self.xt,) |
| 220 | elif hasattr(np_func, "nin") and np_func.nin == 2: # type: ignore[union-attr] |
| 221 | args = (self.x, self.x) # type: ignore[assignment] |
| 222 | else: |
| 223 | args = (self.x,) |
| 224 | |
| 225 | expected = np_func(*args) # type: ignore[misc] |
| 226 | actual = xu_func(*args) |
| 227 | |
| 228 | if name in ["angle", "iscomplex"]: |
| 229 | np.testing.assert_equal(expected, actual.values) |
| 230 | else: |
| 231 | assert_identical(actual, expected) |
| 232 | |
| 233 | def test_ufunc_pickle(self): |
| 234 | a = 1.0 |
nothing calls this directly
no test coverage detected