Skip to content

Commit cc7c6b3

Browse files
committed
Refactor plot tests
1 parent 7c91661 commit cc7c6b3

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

pygmt/tests/test_plot.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
from .. import Figure
1515
from ..exceptions import GMTInvalidInput
16+
from ..helpers.testing import check_figures_equal
1617

1718

1819
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data")
@@ -126,11 +127,21 @@ def test_plot_projection(data):
126127
return fig
127128

128129

129-
@pytest.mark.mpl_image_compare
130+
@check_figures_equal()
130131
def test_plot_colors(data, region):
131132
"Plot the data using z as sizes"
132-
fig = Figure()
133-
fig.plot(
133+
fig_ref, fig_test = Figure(), Figure()
134+
# Use single-character arguments for the reference image
135+
fig_ref.plot(
136+
data=POINTS_DATA,
137+
J="X3i",
138+
R="/".join(map(str, region)),
139+
B="af",
140+
S="c0.5c",
141+
C="cubhelix",
142+
)
143+
144+
fig_test.plot(
134145
x=data[:, 0],
135146
y=data[:, 1],
136147
color=data[:, 2],
@@ -140,7 +151,7 @@ def test_plot_colors(data, region):
140151
cmap="cubhelix",
141152
frame="af",
142153
)
143-
return fig
154+
return fig_ref, fig_test
144155

145156

146157
@pytest.mark.mpl_image_compare

0 commit comments

Comments
 (0)