Skip to content

Commit

Permalink
check that errors in chunk are raised properly
Browse files Browse the repository at this point in the history
  • Loading branch information
keewis committed Oct 24, 2024
1 parent 73b4466 commit 8b35676
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions xarray/tests/test_datatree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2296,3 +2296,12 @@ def test_chunk(self):

assert_identical(actual, expected)
assert actual.chunksizes == expected.chunksizes

with pytest.raises(TypeError, match="invalid type"):
tree.chunk(None)

with pytest.raises(TypeError, match="invalid type"):
tree.chunk((1, 2))

with pytest.raises(ValueError, match="not found in data dimensions"):
tree.chunk({"u": 2})

0 comments on commit 8b35676

Please sign in to comment.