Skip to content
Prev Previous commit
Next Next commit
add shape check to tests
  • Loading branch information
lindseynield committed Sep 18, 2024
commit 1d8410dccd3e4bb73d6efa419a354bbc1bf6b25c
10 changes: 10 additions & 0 deletions tests/v3/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,42 +400,52 @@ def test_group_array_creation(
empty_array = group.empty(shape=shape)
assert isinstance(empty_array, Array)
assert empty_array.fill_value == 0
assert empty_array.shape == shape
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


empty_like_array = group.empty_like(empty_array)
assert isinstance(empty_like_array, Array)
assert empty_like_array.fill_value == 0
assert empty_like_array.shape == shape

empty_array_bool = group.empty(shape=shape, dtype=np.dtype("bool"))
assert isinstance(empty_array_bool, Array)
assert not empty_array_bool.fill_value
assert empty_array.shape == shape

empty_like_array_bool = group.empty_like(empty_array_bool)
assert isinstance(empty_like_array_bool, Array)
assert not empty_like_array_bool.fill_value
assert empty_like_array.shape == shape

zeros_array = group.zeros(shape=shape)
assert isinstance(zeros_array, Array)
assert zeros_array.fill_value == 0
assert zeros_array.shape == shape

zeros_like_array = group.zeros_like(zeros_array)
assert isinstance(zeros_like_array, Array)
assert zeros_like_array.fill_value == 0
assert zeros_like_array.shape == shape

ones_array = group.ones(shape=shape)
assert isinstance(ones_array, Array)
assert ones_array.fill_value == 1
assert ones_array.shape == shape

ones_like_array = group.ones_like(ones_array)
assert isinstance(ones_like_array, Array)
assert ones_like_array.fill_value == 1
assert ones_like_array.shape == shape

full_array = group.full(shape=shape, fill_value=42)
assert isinstance(full_array, Array)
assert full_array.fill_value == 42
assert full_array.shape == shape

full_like_array = group.full_like(full_array, fill_value=43)
assert isinstance(full_like_array, Array)
assert full_like_array.fill_value == 43
assert full_like_array.shape == shape


@pytest.mark.parametrize("store", ("local", "memory", "zip"), indirect=["store"])
Expand Down