Skip to content

Commit 6d77f30

Browse files
committed
simplify the dtype check
1 parent 77f08c8 commit 6d77f30

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: xarray_array_testing/tests/test_cubed.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ class TestReductionCubed(ReductionTests, CubedTestMixin):
6666
def expected_errors(op, **parameters) -> ContextManager:
6767
var = parameters.get("variable")
6868

69+
xp = cubed.array_api
70+
6971
note(f"op = {op}")
7072
note(f"dtype = {var.dtype}")
7173
note(f"is_integer = {cubed.array_api.isdtype(var.dtype, 'integral')}")
7274

73-
if (
74-
op == "mean"
75-
and cubed.array_api.isdtype(var.dtype, "integral")
76-
or var.dtype == np.dtype("float16")
75+
if op == "mean" and xp.isdtype(
76+
var.dtype, ("integral", "complex floating", np.dtype("float16"))
7777
):
7878
return pytest.raises(
7979
TypeError, match="Only real floating-point dtypes are allowed in mean"

0 commit comments

Comments
 (0)