Skip to content

Commit ed96adf

Browse files
authored
Migrate Figure.text tests to dvc
Related to #1131.
1 parent c05c975 commit ed96adf

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

pygmt/tests/test_text.py

+5-10
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ def test_text_angle_font_justify_from_textfile():
304304
return fig
305305

306306

307-
@check_figures_equal()
307+
@pytest.mark.mpl_image_compare
308308
def test_text_transparency():
309309
"""
310310
Add texts with a constant transparency.
@@ -313,17 +313,12 @@ def test_text_transparency():
313313
y = np.arange(11, 20)
314314
text = [f"TEXT-{i}-{j}" for i, j in zip(x, y)]
315315

316-
fig_ref, fig_test = Figure(), Figure()
317-
# Use single-character arguments for the reference image
318-
with GMTTempFile() as tmpfile:
319-
np.savetxt(tmpfile.name, np.c_[x, y, text], fmt="%s")
320-
fig_ref.basemap(R="0/10/10/20", J="X10c", B="")
321-
fig_ref.text(textfiles=tmpfile.name, t=50)
316+
fig = Figure()
322317

323-
fig_test.basemap(region=[0, 10, 10, 20], projection="X10c", frame=True)
324-
fig_test.text(x=x, y=y, text=text, transparency=50)
318+
fig.basemap(region=[0, 10, 10, 20], projection="X10c", frame=True)
319+
fig.text(x=x, y=y, text=text, transparency=50)
325320

326-
return fig_ref, fig_test
321+
return fig
327322

328323

329324
@check_figures_equal()

0 commit comments

Comments
 (0)