From 42b240b083c6e7c03b1a7b1f1096956c01975550 Mon Sep 17 00:00:00 2001 From: Matthew Barber Date: Tue, 8 Feb 2022 10:12:10 +0000 Subject: [PATCH 1/2] Remove values testing for pow --- array_api_tests/test_operators_and_elementwise_functions.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/array_api_tests/test_operators_and_elementwise_functions.py b/array_api_tests/test_operators_and_elementwise_functions.py index 6947c061..eef45c61 100644 --- a/array_api_tests/test_operators_and_elementwise_functions.py +++ b/array_api_tests/test_operators_and_elementwise_functions.py @@ -1143,9 +1143,7 @@ def test_pow(ctx, data): binary_param_assert_dtype(ctx, left, right, res) binary_param_assert_shape(ctx, left, right, res) - binary_param_assert_against_refimpl( - ctx, left, right, res, "**", math.pow, strict_check=False - ) + # Values testing pow is too finicky @pytest.mark.parametrize("ctx", make_binary_params("remainder", dh.numeric_dtypes)) From 9999d96b054868963832a46122366d8e56a0a4e8 Mon Sep 17 00:00:00 2001 From: Matthew Barber Date: Tue, 8 Feb 2022 10:17:25 +0000 Subject: [PATCH 2/2] Fix `dtypes` type hints in elwise+op tests --- array_api_tests/test_operators_and_elementwise_functions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/array_api_tests/test_operators_and_elementwise_functions.py b/array_api_tests/test_operators_and_elementwise_functions.py index eef45c61..4e131050 100644 --- a/array_api_tests/test_operators_and_elementwise_functions.py +++ b/array_api_tests/test_operators_and_elementwise_functions.py @@ -1,7 +1,7 @@ import math import operator from enum import Enum, auto -from typing import Callable, List, NamedTuple, Optional, TypeVar, Union +from typing import Callable, List, NamedTuple, Optional, Sequence, TypeVar, Union import pytest from hypothesis import assume, given @@ -37,7 +37,7 @@ class OnewayPromotableDtypes(NamedTuple): @st.composite def oneway_promotable_dtypes( - draw, dtypes: List[DataType] + draw, dtypes: Sequence[DataType] ) -> st.SearchStrategy[OnewayPromotableDtypes]: """Return a strategy for input dtypes that promote to result dtypes.""" d1, d2 = draw(hh.mutually_promotable_dtypes(dtypes=dtypes)) @@ -346,7 +346,7 @@ def __repr__(self): def make_binary_params( - elwise_func_name: str, dtypes: List[DataType] + elwise_func_name: str, dtypes: Sequence[DataType] ) -> List[Param[BinaryParamContext]]: if hh.FILTER_UNDEFINED_DTYPES: dtypes = [d for d in dtypes if not isinstance(d, xp._UndefinedStub)]