3
3
Tests grdview
4
4
"""
5
5
import pytest
6
+ from packaging .version import Version
6
7
7
- from .. import Figure , which
8
+ from .. import Figure , clib , which
8
9
from ..datasets import load_earth_relief
9
10
from ..exceptions import GMTInvalidInput
10
11
from ..helpers import data_kind
11
12
13
+ with clib .Session () as lib :
14
+ gmt_version = Version (lib .info ["version" ])
15
+
12
16
13
17
@pytest .fixture (scope = "module" )
14
18
def grid ():
@@ -62,6 +66,10 @@ def test_grdview_with_perspective(grid):
62
66
return fig
63
67
64
68
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
+ )
65
73
@pytest .mark .mpl_image_compare
66
74
def test_grdview_with_perspective_and_zscale (grid ):
67
75
"""
@@ -74,6 +82,10 @@ def test_grdview_with_perspective_and_zscale(grid):
74
82
return fig
75
83
76
84
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
+ )
77
89
@pytest .mark .mpl_image_compare
78
90
def test_grdview_with_perspective_and_zsize (grid ):
79
91
"""
@@ -97,6 +109,10 @@ def test_grdview_with_cmap_for_image_plot(grid):
97
109
return fig
98
110
99
111
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
+ )
100
116
@pytest .mark .mpl_image_compare
101
117
def test_grdview_with_cmap_for_surface_monochrome_plot (grid ):
102
118
"""
@@ -108,6 +124,10 @@ def test_grdview_with_cmap_for_surface_monochrome_plot(grid):
108
124
return fig
109
125
110
126
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
+ )
111
131
@pytest .mark .mpl_image_compare
112
132
def test_grdview_with_cmap_for_perspective_surface_plot (grid ):
113
133
"""
@@ -116,11 +136,15 @@ def test_grdview_with_cmap_for_perspective_surface_plot(grid):
116
136
"""
117
137
fig = Figure ()
118
138
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
120
140
)
121
141
return fig
122
142
123
143
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
+ )
124
148
@pytest .mark .mpl_image_compare
125
149
def test_grdview_on_a_plane (grid ):
126
150
"""
@@ -132,6 +156,10 @@ def test_grdview_on_a_plane(grid):
132
156
return fig
133
157
134
158
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
+ )
135
163
@pytest .mark .mpl_image_compare
136
164
def test_grdview_on_a_plane_with_colored_frontal_facade (grid ):
137
165
"""
@@ -143,6 +171,10 @@ def test_grdview_on_a_plane_with_colored_frontal_facade(grid):
143
171
return fig
144
172
145
173
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
+ )
146
178
@pytest .mark .mpl_image_compare
147
179
def test_grdview_with_perspective_and_zaxis_frame (grid ):
148
180
"""
@@ -154,6 +186,10 @@ def test_grdview_with_perspective_and_zaxis_frame(grid):
154
186
return fig
155
187
156
188
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
+ )
157
193
@pytest .mark .mpl_image_compare
158
194
def test_grdview_surface_plot_styled_with_contourpen (grid ):
159
195
"""
@@ -176,6 +212,10 @@ def test_grdview_surface_mesh_plot_styled_with_meshpen(grid):
176
212
return fig
177
213
178
214
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
+ )
179
219
@pytest .mark .mpl_image_compare
180
220
def test_grdview_on_a_plane_styled_with_facadepen (grid ):
181
221
"""
0 commit comments