diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 38e2dce1633..4b3b813d019 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -2340,14 +2340,14 @@ def test_setitem_with_coords(self): actual = ds.copy() actual['var3'] = other assert_identical(expected, actual) - assert 'numbers' in other # should not change other + assert 'numbers' in other.coords # should not change other # with alignment other = ds['var3'].isel(dim3=slice(1, -1)) other['numbers'] = ('dim3', np.arange(8)) actual = ds.copy() actual['var3'] = other - assert 'numbers' in other # should not change other + assert 'numbers' in other.coords # should not change other expected = ds.copy() expected['var3'] = ds['var3'].isel(dim3=slice(1, -1)) assert_identical(expected, actual) @@ -2358,8 +2358,8 @@ def test_setitem_with_coords(self): other['position'] = ('dim3', np.arange(8)) actual = ds.copy() actual['var3'] = other - assert 'position' in actual - assert 'position' in other + assert 'position' in actual.coords + assert 'position' in other.coords # assigning a coordinate-only dataarray actual = ds.copy()