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

Method test_unstack_errors

xarray/tests/test_variable.py:1776–1783  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1774 assert_identical(actual, expected)
1775
1776 def test_unstack_errors(self):
1777 v = Variable("z", [0, 1, 2, 3])
1778 with pytest.raises(ValueError, match=r"invalid existing dim"):
1779 v.unstack(foo={"x": 4})
1780 with pytest.raises(ValueError, match=r"cannot create a new dim"):
1781 v.stack(z=("z",))
1782 with pytest.raises(ValueError, match=r"the product of the new dim"):
1783 v.unstack(z={"x": 5})
1784
1785 def test_unstack_2d(self):
1786 v = Variable(["x", "y"], [[0, 1], [2, 3]])

Callers

nothing calls this directly

Calls 3

unstackMethod · 0.95
stackMethod · 0.95
VariableClass · 0.90

Tested by

no test coverage detected