Skip to content

Commit 5cdb38e

Browse files
committed
Fix more tests
1 parent d68a0cb commit 5cdb38e

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

pygmt/tests/test_clib_put_vector.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import pytest
1111
from pygmt import clib
1212
from pygmt.clib.session import DTYPES_NUMERIC
13-
from pygmt.exceptions import GMTCLibError, GMTInvalidInput
13+
from pygmt.exceptions import GMTCLibError, GMTInvalidInput, GMTTypeError
1414
from pygmt.helpers import GMTTempFile
1515

1616

@@ -225,7 +225,7 @@ def test_put_vector_invalid_dtype():
225225
dim=[2, 3, 0, 0], # ncolumns, nrows, dtype, unused
226226
)
227227
data = np.array([37, 12, 556], dtype=dtype)
228-
with pytest.raises(GMTInvalidInput, match="Unsupported numpy data type"):
228+
with pytest.raises(GMTTypeError, match="Invalida data type"):
229229
lib.put_vector(dataset, column=0, vector=data)
230230

231231

pygmt/tests/test_grdcontour.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88
import pytest
99
from pygmt import Figure
10-
from pygmt.exceptions import GMTInvalidInput
10+
from pygmt.exceptions import GMTTypeError
1111
from pygmt.helpers.testing import load_static_earth_relief
1212

1313
TEST_CONTOUR_FILE = Path(__file__).parent / "data" / "contours.txt"
@@ -123,5 +123,5 @@ def test_grdcontour_fails():
123123
Should fail for unrecognized input.
124124
"""
125125
fig = Figure()
126-
with pytest.raises(GMTInvalidInput):
126+
with pytest.raises(GMTTypeError):
127127
fig.grdcontour(np.arange(20).reshape((4, 5)))

pygmt/tests/test_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytest
1212
import xarray as xr
1313
from pygmt import info
14-
from pygmt.exceptions import GMTInvalidInput
14+
from pygmt.exceptions import GMTTypeError
1515
from pygmt.helpers.testing import skip_if_no
1616

1717
POINTS_DATA = Path(__file__).parent / "data" / "points.txt"
@@ -245,7 +245,7 @@ def test_info_fails():
245245
Make sure info raises an exception if not given either a file name, pandas
246246
DataFrame, or numpy ndarray.
247247
"""
248-
with pytest.raises(GMTInvalidInput):
248+
with pytest.raises(GMTTypeError):
249249
info(data=xr.DataArray(21))
250250

251251

pygmt/tests/test_nearneighbor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from pygmt import nearneighbor
1212
from pygmt.datasets import load_sample_data
1313
from pygmt.enums import GridRegistration, GridType
14-
from pygmt.exceptions import GMTInvalidInput
14+
from pygmt.exceptions import GMTTypeError
1515
from pygmt.helpers import GMTTempFile
1616

1717

@@ -62,7 +62,7 @@ def test_nearneighbor_wrong_kind_of_input(ship_data):
6262
Run nearneighbor using grid input that is not file/matrix/vectors.
6363
"""
6464
data = ship_data.bathymetry.to_xarray() # convert pandas.Series to xarray.DataArray
65-
with pytest.raises(GMTInvalidInput):
65+
with pytest.raises(GMTTypeError):
6666
nearneighbor(
6767
data=data, spacing="5m", region=[245, 255, 20, 30], search_radius="10m"
6868
)

pygmt/tests/test_triangulate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import xarray as xr
1111
from pygmt import triangulate, which
1212
from pygmt.enums import GridRegistration, GridType
13-
from pygmt.exceptions import GMTInvalidInput
13+
from pygmt.exceptions import GMTInvalidInput, GMTTypeError
1414
from pygmt.helpers import GMTTempFile
1515

1616

@@ -94,7 +94,7 @@ def test_delaunay_triples_wrong_kind_of_input(dataframe):
9494
Run triangulate.delaunay_triples using grid input that is not file/matrix/vectors.
9595
"""
9696
data = dataframe.z.to_xarray() # convert pandas.Series to xarray.DataArray
97-
with pytest.raises(GMTInvalidInput):
97+
with pytest.raises(GMTTypeError):
9898
triangulate.delaunay_triples(data=data)
9999

100100

0 commit comments

Comments
 (0)