From c858db897995b667d67a8bd5a0d291a867cb8278 Mon Sep 17 00:00:00 2001 From: Matthew Barber Date: Tue, 17 May 2022 13:12:46 +0100 Subject: [PATCH] Ignore asserting out dtype for undefined dtypes in `test_prod` --- array_api_tests/test_statistical_functions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/array_api_tests/test_statistical_functions.py b/array_api_tests/test_statistical_functions.py index c7d0e842..063df761 100644 --- a/array_api_tests/test_statistical_functions.py +++ b/array_api_tests/test_statistical_functions.py @@ -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 @@ -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", out.shape, x.shape, _axes, kw.get("keepdims", False), **kw