Skip to content

Commit 88320ef

Browse files
committed
rewrite the concat test to pass appropriate arrays
1 parent 6b65a76 commit 88320ef

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

xarray/tests/test_units.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,7 +1915,6 @@ def test_unstack(self, dtype):
19151915
assert_units_equal(expected, actual)
19161916
xr.testing.assert_identical(expected, actual)
19171917

1918-
@pytest.mark.xfail(reason="ignores units")
19191918
@pytest.mark.parametrize(
19201919
"unit,error",
19211920
(
@@ -1930,12 +1929,12 @@ def test_unstack(self, dtype):
19301929
)
19311930
def test_concat(self, unit, error, dtype):
19321931
array1 = (
1933-
np.linspace(0, 5, 3 * 10).reshape(3, 10).astype(dtype) * unit_registry.m
1932+
np.linspace(0, 5, 9 * 10).reshape(3, 6, 5).astype(dtype) * unit_registry.m
19341933
)
1935-
array2 = np.linspace(5, 10, 10 * 2).reshape(10, 2).astype(dtype) * unit
1934+
array2 = np.linspace(5, 10, 10 * 3).reshape(3, 2, 5).astype(dtype) * unit
19361935

1937-
variable = xr.Variable(("x", "y"), array1)
1938-
other = xr.Variable(("y", "z"), array2)
1936+
variable = xr.Variable(("x", "y", "z"), array1)
1937+
other = xr.Variable(("x", "y", "z"), array2)
19391938

19401939
if error is not None:
19411940
with pytest.raises(error):

0 commit comments

Comments
 (0)