Skip to content

Commit

Permalink
Merge pull request #122 from honno/prod-partial-dtypes
Browse files Browse the repository at this point in the history
Ignore asserting out dtype for undefined dtypes in `test_prod`
  • Loading branch information
honno committed May 17, 2022
2 parents 88aed26 + c858db8 commit 71639af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion array_api_tests/test_statistical_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from . import pytest_helpers as ph
from . import shape_helpers as sh
from . import xps
from ._array_module import _UndefinedStub
from .typing import DataType

pytestmark = pytest.mark.ci
Expand Down Expand Up @@ -144,7 +145,10 @@ def test_prod(x, data):
_dtype = dh.default_float
else:
_dtype = dtype
ph.assert_dtype("prod", x.dtype, out.dtype, _dtype)
# We ignore asserting the out dtype if what we expect is undefined
# See https://github.com/data-apis/array-api-tests/issues/106
if not isinstance(_dtype, _UndefinedStub):
ph.assert_dtype("prod", x.dtype, out.dtype, _dtype)
_axes = sh.normalise_axis(kw.get("axis", None), x.ndim)
ph.assert_keepdimable_shape(
"prod", x.shape, out.shape, _axes, kw.get("keepdims", False), **kw
Expand Down

0 comments on commit 71639af

Please sign in to comment.