Skip to content

Commit 4f09ba6

Browse files
authored
Figure.pygmtlogo: Parameterize existing tests (#4639)
1 parent 1ea6e8e commit 4f09ba6

6 files changed

Lines changed: 21 additions & 18 deletions

pygmt/tests/baseline/test_pygmtlogo_circle_design_horizontal.png.dvc

Lines changed: 0 additions & 5 deletions
This file was deleted.

pygmt/tests/baseline/test_pygmtlogo_circle_design_vertical.png.dvc

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 8924c7d80afcc92df4e77e6856b553a4
3+
size: 336254
4+
hash: md5
5+
path: test_pygmtlogo_design_circle-horizontal.png
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
outs:
2+
- md5: 5ee82660f20bc8424f3051af4f9fb9ac
3+
size: 173671
4+
hash: md5
5+
path: test_pygmtlogo_design_circle-vertical.png

pygmt/tests/baseline/test_pygmtlogo_circle_no_wordmark.png.dvc renamed to pygmt/tests/baseline/test_pygmtlogo_wordmark_none_circle.png.dvc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ outs:
22
- md5: fdc90d2867bcbc096bcf5a9303d15ddf
33
size: 31962
44
hash: md5
5-
path: test_pygmtlogo_circle_no_wordmark.png
5+
path: test_pygmtlogo_wordmark_none_circle.png

pygmt/tests/test_pygmtlogo.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,25 @@
1010

1111
@pytest.mark.mpl_image_compare(savefig_kwargs={"dpi": 600})
1212
@pytest.mark.parametrize("wordmark", ["horizontal", "vertical"])
13-
def test_pygmtlogo_circle_design(wordmark):
13+
@pytest.mark.parametrize("shape", ["circle"])
14+
def test_pygmtlogo_design(shape, wordmark):
1415
"""
15-
Test the design details of the PyGMT circular logo, with a wordmark.
16+
Test the design details of the PyGMT logo with a wordmark.
1617
1718
This is a regression test to ensure that the design of the logo does not change
1819
unintentionally. The debugging lines (gridlines and circles) are helpful for
1920
implementing the logo, but they are not included in the final logo design.
2021
"""
21-
fig = _create_logo(debug=True, wordmark=wordmark)
22+
fig = _create_logo(debug=True, shape=shape, wordmark=wordmark)
2223
return fig
2324

2425

2526
@pytest.mark.mpl_image_compare
26-
def test_pygmtlogo_circle_no_wordmark():
27+
@pytest.mark.parametrize("shape", ["circle"])
28+
def test_pygmtlogo_wordmark_none(shape):
2729
"""
28-
Test the PyGMT circular logo without the wordmark, including both light/dark themes,
29-
and colored/black-and-white versions.
30+
Test the PyGMT logo without the wordmark, including both light/dark themes, and
31+
colored/black-and-white versions.
3032
"""
3133
fig = Figure()
3234
fig.basemap(
@@ -41,8 +43,9 @@ def test_pygmtlogo_circle_no_wordmark():
4143
((3.5, 1.0), "dark", False),
4244
]:
4345
fig.pygmtlogo(
44-
position=Position((x, y), anchor="CM", cstype="mapcoords"),
46+
position=Position((x, y), anchor="MC", cstype="mapcoords"),
4547
theme=theme,
4648
color=color,
49+
shape=shape,
4750
)
4851
return fig

0 commit comments

Comments
 (0)