33Tests grdview
44"""
55import pytest
6+ from packaging .version import Version
67
7- from .. import Figure , which
8+ from .. import Figure , clib , which
89from ..datasets import load_earth_relief
910from ..exceptions import GMTInvalidInput
1011from ..helpers import data_kind
1112
13+ with clib .Session () as lib :
14+ gmt_version = Version (lib .info ["version" ])
15+
1216
1317@pytest .fixture (scope = "module" )
1418def grid ():
@@ -62,6 +66,10 @@ def test_grdview_with_perspective(grid):
6266 return fig
6367
6468
69+ @pytest .mark .xfail (
70+ condition = gmt_version < Version ("6.1.0" ),
71+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
72+ )
6573@pytest .mark .mpl_image_compare
6674def test_grdview_with_perspective_and_zscale (grid ):
6775 """
@@ -74,6 +82,10 @@ def test_grdview_with_perspective_and_zscale(grid):
7482 return fig
7583
7684
85+ @pytest .mark .xfail (
86+ condition = gmt_version < Version ("6.1.0" ),
87+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
88+ )
7789@pytest .mark .mpl_image_compare
7890def test_grdview_with_perspective_and_zsize (grid ):
7991 """
@@ -97,6 +109,10 @@ def test_grdview_with_cmap_for_image_plot(grid):
97109 return fig
98110
99111
112+ @pytest .mark .xfail (
113+ condition = gmt_version < Version ("6.1.0" ),
114+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
115+ )
100116@pytest .mark .mpl_image_compare
101117def test_grdview_with_cmap_for_surface_monochrome_plot (grid ):
102118 """
@@ -108,6 +124,10 @@ def test_grdview_with_cmap_for_surface_monochrome_plot(grid):
108124 return fig
109125
110126
127+ @pytest .mark .xfail (
128+ condition = gmt_version < Version ("6.1.0" ),
129+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
130+ )
111131@pytest .mark .mpl_image_compare
112132def test_grdview_with_cmap_for_perspective_surface_plot (grid ):
113133 """
@@ -116,11 +136,15 @@ def test_grdview_with_cmap_for_perspective_surface_plot(grid):
116136 """
117137 fig = Figure ()
118138 fig .grdview (
119- grid = grid , cmap = "oleron" , surftype = "s" , perspective = [225 , 30 ], zscale = 0.005 ,
139+ grid = grid , cmap = "oleron" , surftype = "s" , perspective = [225 , 30 ], zscale = 0.005
120140 )
121141 return fig
122142
123143
144+ @pytest .mark .xfail (
145+ condition = gmt_version < Version ("6.1.0" ),
146+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
147+ )
124148@pytest .mark .mpl_image_compare
125149def test_grdview_on_a_plane (grid ):
126150 """
@@ -132,6 +156,10 @@ def test_grdview_on_a_plane(grid):
132156 return fig
133157
134158
159+ @pytest .mark .xfail (
160+ condition = gmt_version < Version ("6.1.0" ),
161+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
162+ )
135163@pytest .mark .mpl_image_compare
136164def test_grdview_on_a_plane_with_colored_frontal_facade (grid ):
137165 """
@@ -143,6 +171,10 @@ def test_grdview_on_a_plane_with_colored_frontal_facade(grid):
143171 return fig
144172
145173
174+ @pytest .mark .xfail (
175+ condition = gmt_version < Version ("6.1.0" ),
176+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
177+ )
146178@pytest .mark .mpl_image_compare
147179def test_grdview_with_perspective_and_zaxis_frame (grid ):
148180 """
@@ -154,6 +186,10 @@ def test_grdview_with_perspective_and_zaxis_frame(grid):
154186 return fig
155187
156188
189+ @pytest .mark .xfail (
190+ condition = gmt_version < Version ("6.1.0" ),
191+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
192+ )
157193@pytest .mark .mpl_image_compare
158194def test_grdview_surface_plot_styled_with_contourpen (grid ):
159195 """
@@ -176,6 +212,10 @@ def test_grdview_surface_mesh_plot_styled_with_meshpen(grid):
176212 return fig
177213
178214
215+ @pytest .mark .xfail (
216+ condition = gmt_version < Version ("6.1.0" ),
217+ reason = "Baseline image not updated to use earth relief grid in GMT 6.1.0" ,
218+ )
179219@pytest .mark .mpl_image_compare
180220def test_grdview_on_a_plane_styled_with_facadepen (grid ):
181221 """
0 commit comments