Skip to content

Commit

Permalink
Improved clarity in ellipsis indices test (NumPy and Array API)
Browse files Browse the repository at this point in the history
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
  • Loading branch information
honno and Zac-HD committed Sep 10, 2021
1 parent b6c2e42 commit fba0fb2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions hypothesis-python/tests/array_api/test_indices.py
Expand Up @@ -66,8 +66,9 @@ def test_indices_can_generate_long_ellipsis():
)
)
def test_indices_replaces_whole_axis_slices_with_ellipsis(idx):
# When a shape's dimension sizes are 0, ... in indices replaces all slice
# and integer entries in the index.
# `slice(None)` (aka `:`) is the only valid index for an axis of size
# zero, so if all dimensions are 0 then a `...` will replace all the
# slices because we generate `...` for entire contiguous runs of `:`
assert slice(None) not in idx


Expand Down
5 changes: 3 additions & 2 deletions hypothesis-python/tests/numpy/test_gen_data.py
Expand Up @@ -1106,8 +1106,9 @@ def test_basic_indices_can_generate_long_ellipsis():
)
)
def test_basic_indices_replaces_whole_axis_slices_with_ellipsis(idx):
# When a shape's dimension sizes are 0, ... in indices replaces all slice
# and integer entries in the index.
# `slice(None)` (aka `:`) is the only valid index for an axis of size
# zero, so if all dimensions are 0 then a `...` will replace all the
# slices because we generate `...` for entire contiguous runs of `:`
assert slice(None) not in idx


Expand Down

0 comments on commit fba0fb2

Please sign in to comment.