Skip to content

Commit bbe6c16

Browse files
committed
print the type of actual if it didn't match
1 parent b42cd4f commit bbe6c16

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

xarray_array_testing/reduction.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def test_variable_numerical_reduce(self, op, data):
2525
# compute using xp.<OP>(array)
2626
expected = getattr(self.xp, op)(variable.data)
2727

28+
assert isinstance(actual, self.array_type), f"wrong type: {type(actual)}"
2829
self.assert_equal(actual, expected)
2930

3031
@pytest.mark.parametrize("op", ["all", "any"])
@@ -38,7 +39,7 @@ def test_variable_boolean_reduce(self, op, data):
3839
# compute using xp.<OP>(array)
3940
expected = getattr(self.xp, op)(variable.data)
4041

41-
assert isinstance(actual, self.array_type)
42+
assert isinstance(actual, self.array_type), f"wrong type: {type(actual)}"
4243
self.assert_equal(actual, expected)
4344

4445
@pytest.mark.parametrize("op", ["max", "min"])
@@ -52,7 +53,7 @@ def test_variable_order_reduce(self, op, data):
5253
# compute using xp.<OP>(array)
5354
expected = getattr(self.xp, op)(variable.data)
5455

55-
assert isinstance(actual, self.array_type)
56+
assert isinstance(actual, self.array_type), f"wrong type: {type(actual)}"
5657
self.assert_equal(actual, expected)
5758

5859
@pytest.mark.parametrize("op", ["argmax", "argmin"])
@@ -95,5 +96,5 @@ def test_variable_cumulative_reduce(self, op, data):
9596
for axis in range(variable.ndim):
9697
expected = getattr(self.xp, array_api_names[op])(expected, axis=axis)
9798

98-
assert isinstance(actual, self.array_type)
99+
assert isinstance(actual, self.array_type), f"wrong type: {type(actual)}"
99100
self.assert_equal(actual, expected)

0 commit comments

Comments
 (0)