Skip to content

Commit a6a0919

Browse files
authored
Mark xarray shading test fail for GMT<=6.1.1 (#649)
The xarray shading issue in #364 was fixed by upstream GMT in GenericMappingTools/gmt#4328. This PR updates the pytest xfail condition so that the xarray shading test is expected to xfail only for GMT<=6.1.1.
1 parent 3613b19 commit a6a0919

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pygmt/tests/test_grdimage.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44
import numpy as np
55
import pytest
66
import xarray as xr
7+
from packaging.version import Version
78

8-
from .. import Figure
9+
from .. import Figure, clib
910
from ..datasets import load_earth_relief
1011
from ..exceptions import GMTInvalidInput
1112
from ..helpers.testing import check_figures_equal
1213

14+
with clib.Session() as _lib:
15+
gmt_version = Version(_lib.info["version"])
16+
1317

1418
@pytest.fixture(scope="module", name="grid")
1519
def fixture_grid():
@@ -69,7 +73,10 @@ def test_grdimage_file():
6973
return fig
7074

7175

72-
@pytest.mark.xfail(reason="Upstream bug in GMT 6.1.1")
76+
@pytest.mark.xfail(
77+
reason="Upstream bug in GMT 6.1.1",
78+
condition=gmt_version <= Version("6.1.1"),
79+
)
7380
@check_figures_equal()
7481
def test_grdimage_xarray_shading(grid):
7582
"""

0 commit comments

Comments
 (0)