diff --git a/tests/test_ndarray.py b/tests/test_ndarray.py index 73abedf..7be03bb 100644 --- a/tests/test_ndarray.py +++ b/tests/test_ndarray.py @@ -172,6 +172,18 @@ def test_ndarray_coercion(): amod = Model(array=["a", "b", "c"]) +@pytest.mark.shape +def test_shape_ellipsis(): + """ + Test that ellipsis is a wildcard, rather than "repeat the last index" + """ + + class MyModel(BaseModel): + array: NDArray[Shape["1, 2, ..."], Number] + + _ = MyModel(array=np.zeros((1, 2, 3, 4, 5))) + + @pytest.mark.serialization def test_ndarray_serialize(): """ diff --git a/tests/test_serialization.py b/tests/test_serialization.py index 569168c..dc0ef06 100644 --- a/tests/test_serialization.py +++ b/tests/test_serialization.py @@ -12,6 +12,8 @@ from typing import Callable import numpy as np import json +pytestmark = pytest.mark.serialization + @pytest.fixture(scope="module") def hdf5_at_path() -> Callable[[Path], None]: