Skip to content

Commit

Permalink
Update regex error message
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Aug 28, 2024
1 parent 3923088 commit f7a6039
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion geoutils/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -1138,7 +1138,7 @@ def reproject(
try:
ds_ref = Vector(ref)
except pyogrio.errors.DataSourceError:
raise ValueError("Could not open raster or vector with rasterio or fiona.")
raise ValueError("Could not open raster or vector with rasterio or pyogrio.")
else:
raise TypeError("Type of ref must be string path to file, Raster or Vector.")

Expand Down
4 changes: 1 addition & 3 deletions tests/test_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,7 @@ def test_reproject(self) -> None:
with pytest.raises(ValueError, match=re.escape("Reference raster or vector path does not exist.")):
v0.reproject(ref="tmp.lol")
# If it exists but cannot be opened by rasterio or fiona
with pytest.raises(
ValueError, match=re.escape("'geoutils/examples.py' not recognized as being in a supported file format.")
):
with pytest.raises(ValueError, match=re.escape("Could not open raster or vector with rasterio or pyogrio.")):
v0.reproject(ref="geoutils/examples.py")
# If input of wrong type
with pytest.raises(TypeError, match=re.escape("Type of ref must be string path to file, Raster or Vector.")):
Expand Down

0 comments on commit f7a6039

Please sign in to comment.