diff --git a/xarray/tests/test_dataset.py b/xarray/tests/test_dataset.py index 92f86f4fcf3..7ababde0bdf 100644 --- a/xarray/tests/test_dataset.py +++ b/xarray/tests/test_dataset.py @@ -873,8 +873,10 @@ def test_sel(self): data = Dataset({'x': ('td', np.arange(3)), 'td': td}) self.assertDatasetEqual(data, data.sel(td=td)) self.assertDatasetEqual(data, data.sel(td=slice('3 days'))) - self.assertDatasetEqual(data.isel(td=0), data.sel(td='0 days')) - self.assertDatasetEqual(data.isel(td=0), data.sel(td='0h')) + self.assertDatasetEqual(data.isel(td=0), + data.sel(td=pd.Timedelta('0 days'))) + self.assertDatasetEqual(data.isel(td=0), + data.sel(td=pd.Timedelta('0h'))) self.assertDatasetEqual(data.isel(td=slice(1, 3)), data.sel(td=slice('1 days', '2 days')))