Skip to content

Commit aae17fc

Browse files
authored
Merge pull request #97 from honno/minor-elwise-fixes
Minor elwise+op fixes
2 parents 1ae5ea7 + 9999d96 commit aae17fc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

array_api_tests/test_operators_and_elementwise_functions.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import math
22
import operator
33
from enum import Enum, auto
4-
from typing import Callable, List, NamedTuple, Optional, TypeVar, Union
4+
from typing import Callable, List, NamedTuple, Optional, Sequence, TypeVar, Union
55

66
import pytest
77
from hypothesis import assume, given
@@ -37,7 +37,7 @@ class OnewayPromotableDtypes(NamedTuple):
3737

3838
@st.composite
3939
def oneway_promotable_dtypes(
40-
draw, dtypes: List[DataType]
40+
draw, dtypes: Sequence[DataType]
4141
) -> st.SearchStrategy[OnewayPromotableDtypes]:
4242
"""Return a strategy for input dtypes that promote to result dtypes."""
4343
d1, d2 = draw(hh.mutually_promotable_dtypes(dtypes=dtypes))
@@ -346,7 +346,7 @@ def __repr__(self):
346346

347347

348348
def make_binary_params(
349-
elwise_func_name: str, dtypes: List[DataType]
349+
elwise_func_name: str, dtypes: Sequence[DataType]
350350
) -> List[Param[BinaryParamContext]]:
351351
if hh.FILTER_UNDEFINED_DTYPES:
352352
dtypes = [d for d in dtypes if not isinstance(d, xp._UndefinedStub)]
@@ -1143,9 +1143,7 @@ def test_pow(ctx, data):
11431143

11441144
binary_param_assert_dtype(ctx, left, right, res)
11451145
binary_param_assert_shape(ctx, left, right, res)
1146-
binary_param_assert_against_refimpl(
1147-
ctx, left, right, res, "**", math.pow, strict_check=False
1148-
)
1146+
# Values testing pow is too finicky
11491147

11501148

11511149
@pytest.mark.parametrize("ctx", make_binary_params("remainder", dh.numeric_dtypes))

0 commit comments

Comments
 (0)