diff --git a/tests/datasets/test_agb_live_woody_density.py b/tests/datasets/test_agb_live_woody_density.py index 6bfc72ba04a..ae775a1cabf 100644 --- a/tests/datasets/test_agb_live_woody_density.py +++ b/tests/datasets/test_agb_live_woody_density.py @@ -52,9 +52,9 @@ def test_getitem(self, dataset: AbovegroundLiveWoodyBiomassDensity) -> None: assert isinstance(x["crs"], CRS) assert isinstance(x["mask"], torch.Tensor) - def test_no_dataset(self) -> None: - with pytest.raises(RuntimeError, match="Dataset not found in."): - AbovegroundLiveWoodyBiomassDensity("/test") + def test_no_dataset(self, tmp_path: Path) -> None: + with pytest.raises(RuntimeError, match="Dataset not found"): + AbovegroundLiveWoodyBiomassDensity(str(tmp_path)) def test_already_downloaded( self, dataset: AbovegroundLiveWoodyBiomassDensity diff --git a/tests/datasets/test_cms_mangrove_canopy.py b/tests/datasets/test_cms_mangrove_canopy.py index f5ffc818d35..3c9ea05e65a 100644 --- a/tests/datasets/test_cms_mangrove_canopy.py +++ b/tests/datasets/test_cms_mangrove_canopy.py @@ -44,9 +44,9 @@ def test_getitem(self, dataset: CMSGlobalMangroveCanopy) -> None: assert isinstance(x["crs"], CRS) assert isinstance(x["mask"], torch.Tensor) - def test_no_dataset(self) -> None: - with pytest.raises(RuntimeError, match="Dataset not found in."): - CMSGlobalMangroveCanopy("/test") + def test_no_dataset(self, tmp_path: Path) -> None: + with pytest.raises(RuntimeError, match="Dataset not found"): + CMSGlobalMangroveCanopy(str(tmp_path)) def test_already_downloaded(self, tmp_path: Path) -> None: pathname = os.path.join(