Skip to content

Commit 94e4598

Browse files
authored
Refactor test_image to plot @circuit.png instead of test_logo.png (#2922)
So that we don't need to pull test_logo.png from dvc, or run test_logo first to generate the image. * Add @circuit.png to cache * Remove dvc pull step from ci_tests_legacy.yaml * Try running test_image on Windows to see if it crashes
1 parent c550f83 commit 94e4598

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

.github/workflows/ci_tests_legacy.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ jobs:
7676
rioxarray
7777
sphinx-gallery
7878
build
79-
dvc
8079
make
8180
pip
8281
pytest
@@ -101,10 +100,6 @@ jobs:
101100
touch ~/.gmt/server/gmt_data_server.txt ~/.gmt/server/gmt_hash_server.txt
102101
ls -lhR ~/.gmt
103102
104-
# Pull baseline image data from dvc remote (DAGsHub)
105-
- name: Pull baseline image data from dvc remote
106-
run: dvc pull pygmt/tests/baseline/test_logo.png && ls -lhR pygmt/tests/baseline/
107-
108103
# Install the package that we want to test
109104
- name: Install the package
110105
run: make install

pygmt/helpers/testing.py

+1
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ def download_test_data():
202202
"@S90E000.earth_wdmam_03m_g.nc", # Specific grid for 03m test
203203
# Other cache files
204204
"@capitals.gmt",
205+
"@circuit.png",
205206
"@earth_relief_20m_holes.grd",
206207
"@EGM96_to_36.txt",
207208
"@MaunaLoa_CO2.txt",
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
outs:
2-
- md5: c2e05c0d6fb17bcc7bf2f96193f91ad6
3-
size: 10005
2+
- md5: d7d0d71a44a232d5907dbd44f7a08f18
3+
size: 30811
44
path: test_image.png

pygmt/tests/test_image.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
"""
22
Test Figure.image.
33
"""
4-
import os
5-
import sys
6-
74
import pytest
85
from pygmt import Figure
96

10-
TEST_IMG = os.path.join(os.path.dirname(__file__), "baseline", "test_logo.png")
11-
127

13-
@pytest.mark.skipif(sys.platform == "win32", reason="crashes on Windows")
148
@pytest.mark.mpl_image_compare
159
def test_image():
1610
"""
1711
Place images on map.
1812
"""
1913
fig = Figure()
20-
fig.image(TEST_IMG, position="x0/0+w2c", box="+pthin,blue")
14+
fig.image(imagefile="@circuit.png", position="x0/0+w2c", box="+pthin,blue")
2115
return fig

0 commit comments

Comments
 (0)