4
4
import os
5
5
6
6
import pytest
7
- from pygmt import Figure
7
+ from pygmt import Figure , grd2cpt
8
8
from pygmt .datasets import load_earth_relief
9
9
from pygmt .exceptions import GMTInvalidInput
10
10
from pygmt .helpers import GMTTempFile
11
- from pygmt .helpers .testing import check_figures_equal
12
- from pygmt .src .grd2cpt import grd2cpt
13
11
14
12
15
13
@pytest .fixture (scope = "module" , name = "grid" )
@@ -20,21 +18,17 @@ def fixture_grid():
20
18
return load_earth_relief ()
21
19
22
20
23
- @check_figures_equal ()
21
+ @pytest . mark . mpl_image_compare
24
22
def test_grd2cpt (grid ):
25
23
"""
26
24
Test creating a CPT with grd2cpt to create a CPT based off a grid input and
27
25
plot it with a color bar.
28
26
"""
29
- fig_ref , fig_test = Figure (), Figure ()
30
- # Use single-character arguments for the reference image
31
- fig_ref .basemap (B = "a" , J = "W0/15c" , R = "d" )
32
- grd2cpt (grid = "@earth_relief_01d" )
33
- fig_ref .colorbar (B = "a2000" )
34
- fig_test .basemap (frame = "a" , projection = "W0/15c" , region = "d" )
27
+ fig = Figure ()
28
+ fig .basemap (frame = "a" , projection = "W0/15c" , region = "d" )
35
29
grd2cpt (grid = grid )
36
- fig_test .colorbar (frame = "a2000" )
37
- return fig_ref , fig_test
30
+ fig .colorbar (frame = "a2000" )
31
+ return fig
38
32
39
33
40
34
def test_grd2cpt_blank_output (grid ):
0 commit comments