We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 05c7888 commit aad606aCopy full SHA for aad606a
xarray/tests/test_ufuncs.py
@@ -4,7 +4,7 @@
4
import pytest
5
6
import xarray as xr
7
-from xarray.tests import assert_array_equal, mock
+from xarray.tests import assert_allclose, assert_array_equal, mock
8
from xarray.tests import assert_identical as assert_identical_
9
10
@@ -16,16 +16,16 @@ def assert_identical(a, b):
16
assert_array_equal(a, b)
17
18
19
-def test_unary():
20
- args = [
21
- 0,
22
- np.zeros(2),
+@pytest.mark.parametrize(
+ "a",
+ [
23
xr.Variable(["x"], [0, 0]),
24
xr.DataArray([0, 0], dims="x"),
25
xr.Dataset({"y": ("x", [0, 0])}),
26
- ]
27
- for a in args:
28
- assert_identical(a + 1, np.cos(a))
+ ],
+)
+def test_unary(a):
+ assert_allclose(a + 1, np.cos(a))
29
30
31
def test_binary():
0 commit comments