MCPcopy Index your code
hub / github.com/pydata/xarray / test_init_index_error

Method test_init_index_error

xarray/tests/test_coordinates.py:63–72  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

61 assert len(coords) == 0
62
63 def test_init_index_error(self) -> None:
64 idx = PandasIndex([1, 2, 3], "x")
65 with pytest.raises(ValueError, match="no coordinate variables found"):
66 Coordinates(indexes={"x": idx})
67
68 with pytest.raises(TypeError, match=r".* is not an `xarray.indexes.Index`"):
69 Coordinates(
70 coords={"x": ("x", [1, 2, 3])},
71 indexes={"x": "not_an_xarray_index"}, # type: ignore[dict-item]
72 )
73
74 def test_init_dim_sizes_conflict(self) -> None:
75 with pytest.raises(ValueError):

Callers

nothing calls this directly

Calls 2

PandasIndexClass · 0.90
CoordinatesClass · 0.90

Tested by

no test coverage detected