Skip to content

Commit 2068ee4

Browse files
committed
Better repr for failing ipow special case test
1 parent 9eac45b commit 2068ee4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Diff for: .github/workflows/numpy.yml

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
array_api_tests/test_set_functions.py
4646
# https://github.com/numpy/numpy/issues/21211
4747
array_api_tests/test_special_cases.py::test_iop[__iadd__(x1_i is -0 and x2_i is -0) -> -0]
48+
# https://github.com/numpy/numpy/issues/21213
49+
array_api_tests/test_special_cases.py::test_iop[__ipow__(x1_i is -0 and x2_i > 0 and not (x2_i.is_integer() and x2_i % 2 == 1)) -> +0]
4850
# noted diversions from spec
4951
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i > 0) -> +infinity]
5052
array_api_tests/test_special_cases.py::test_binary[floor_divide(x1_i is +infinity and isfinite(x2_i) and x2_i < 0) -> -infinity]

Diff for: array_api_tests/test_special_cases.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ def parse_cond(cond_str: str) -> Tuple[UnaryCheck, str, BoundFromDtype]:
437437
elif cond_str == "an odd integer value":
438438
cond = lambda i: i.is_integer() and i % 2 == 1
439439
expr_template = "{}.is_integer() and {} % 2 == 1"
440-
from_dtype = integers_from_dtype # type: ignore
440+
if not_cond:
441+
expr_template = f"({expr_template})"
441442

442443
def from_dtype(dtype: DataType, **kw) -> st.SearchStrategy[float]:
443444
return integers_from_dtype(dtype, **kw).filter(lambda n: n % 2 == 1)

0 commit comments

Comments
 (0)