Skip to content

Commit 3a371d0

Browse files
authored
Mark test_accessor_sliced_datacube as xfail due to upstream bug (#1895)
1 parent c8e89b9 commit 3a371d0

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

pygmt/tests/test_accessor.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55

66
import pytest
77
import xarray as xr
8-
from pygmt import which
8+
from packaging.version import Version
9+
from pygmt import clib, which
910
from pygmt.exceptions import GMTInvalidInput
1011

12+
with clib.Session() as _lib:
13+
gmt_version = Version(_lib.info["version"])
14+
1115

1216
def test_accessor_gridline_cartesian():
1317
"""
@@ -70,6 +74,10 @@ def test_accessor_set_non_boolean():
7074
grid.gmt.gtype = 2
7175

7276

77+
@pytest.mark.skipif(
78+
gmt_version < Version("6.4.0"),
79+
reason="Upstream bug fixed in https://github.com/GenericMappingTools/gmt/pull/6615",
80+
)
7381
def test_accessor_sliced_datacube():
7482
"""
7583
Check that a 2D grid which is sliced from an n-dimensional datacube works
@@ -87,6 +95,6 @@ def test_accessor_sliced_datacube():
8795
grid = dataset.sel(level=500, month=1, drop=True).z
8896

8997
assert grid.gmt.registration == 0 # gridline registration
90-
assert grid.gmt.gtype == 0 # cartesian coordinate type
98+
assert grid.gmt.gtype == 1 # geographic coordinate type
9199
finally:
92100
os.remove(fname)

0 commit comments

Comments
 (0)