(self)
| 6728 | assert_identical(expected, actual) |
| 6729 | |
| 6730 | def test_dataset_math_errors(self) -> None: |
| 6731 | ds = self.make_example_math_dataset() |
| 6732 | |
| 6733 | with pytest.raises(TypeError): |
| 6734 | ds["foo"] += ds |
| 6735 | with pytest.raises(TypeError): |
| 6736 | ds["foo"].variable += ds |
| 6737 | with pytest.raises(ValueError, match=r"must have the same"): |
| 6738 | ds += ds[["bar"]] |
| 6739 | |
| 6740 | # verify we can rollback in-place operations if something goes wrong |
| 6741 | # nb. inplace datetime64 math actually will work with an integer array |
| 6742 | # but not floats thanks to numpy's inconsistent handling |
| 6743 | other = DataArray(np.datetime64("2000-01-01"), coords={"c": 2}) |
| 6744 | actual = ds.copy(deep=True) |
| 6745 | with pytest.raises(TypeError): |
| 6746 | actual += other |
| 6747 | assert_identical(actual, ds) |
| 6748 | |
| 6749 | def test_dataset_transpose(self) -> None: |
| 6750 | ds = Dataset( |
nothing calls this directly
no test coverage detected