Skip to content

Commit 0c9ecbf

Browse files
committed
[test] Added test for unmatched flex shape dataset
1 parent 3c42527 commit 0c9ecbf

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

tests/test_dataset.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,21 @@ def test_dtype_mutation(self):
7979
class TestDatasetShape:
8080
@pytest.mark.xfail(raises=ValueError)
8181
@pytest.mark.parametrize(
82-
"shape",
82+
("shape", "data_shape"),
8383
[
84-
(0,),
85-
(1,),
86-
(99,),
87-
(1, 1),
84+
((0,), (100,)),
85+
((1,), (100,)),
86+
((99,), (100,)),
87+
((1, 1), (100,)),
88+
((100, None), (100,)),
89+
((None, None), (100,)),
90+
((None, 100), (100,)),
8891
],
8992
)
90-
def test_unmatched_shape_data(self, shape):
91-
ds = Dataset(dtype="float64", shape=(100,))
93+
def test_unmatched_shape_data(self, shape, data_shape):
94+
ds = Dataset(dtype="float64", shape=shape)
9295

93-
data = np.random.rand(*shape)
96+
data = np.random.rand(*data_shape)
9497
ds.data = data
9598

9699
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)