Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions array_api_tests/test_searching_functions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import math

import pytest
from hypothesis import given, note
from hypothesis import given, note, assume
from hypothesis import strategies as st

from . import _array_module as xp
Expand Down Expand Up @@ -106,13 +106,15 @@ def test_argmin(x, data):
def test_count_nonzero(x, data):
kw = data.draw(
hh.kwargs(
axis=st.none() | st.integers(-x.ndim, max(x.ndim - 1, 0)),
axis=hh.axes(x.ndim),
keepdims=st.booleans(),
),
label="kw",
)
keepdims = kw.get("keepdims", False)

assume(kw.get("axis", None) != ()) # TODO clarify in the spec

out = xp.count_nonzero(x, **kw)

ph.assert_default_index("count_nonzero", out.dtype)
Expand Down