Skip to content

Commit 7be772b

Browse files
Migrate Figure.legend tests to use dvc (#1166)
1 parent 143f943 commit 7be772b

7 files changed

+14
-11
lines changed
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
outs:
2+
- md5: 7cc85638c576d10348126373fc2a5762
3+
size: 25898
4+
path: test_legend_default_position.png
-23.8 KB
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
outs:
2+
- md5: d794a59f0fbdb7c8e8a4a1ea5c741470
3+
size: 24298
4+
path: test_legend_position.png
-60.2 KB
Binary file not shown.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
outs:
2+
- md5: 5d0420febe0e0a5ae9ffc0a67879fc61
3+
size: 61634
4+
path: test_legend_specfile.png

pygmt/tests/test_legend.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,22 @@
1010
@pytest.mark.mpl_image_compare
1111
def test_legend_position():
1212
"""
13-
Try positioning with each of the four legend coordinate systems.
13+
Test that plots a position with each of the four legend coordinate systems.
1414
"""
1515

1616
fig = Figure()
17-
1817
fig.basemap(region=[-2, 2, -2, 2], frame=True)
19-
2018
positions = ["jTR+jTR", "g0/1", "n0.2/0.2", "x4i/2i/2i"]
21-
2219
for i, position in enumerate(positions):
23-
2420
fig.plot(x=[0], y=[0], style="p10p", label=i)
2521
fig.legend(position=position, box=True)
26-
2722
return fig
2823

2924

3025
@pytest.mark.mpl_image_compare
3126
def test_legend_default_position():
3227
"""
33-
Try using the default legend position.
28+
Test using the default legend position.
3429
"""
3530

3631
fig = Figure()
@@ -98,15 +93,11 @@ def test_legend_specfile():
9893
"""
9994

10095
with GMTTempFile() as specfile:
101-
10296
with open(specfile.name, "w") as file:
10397
file.write(specfile_contents)
104-
10598
fig = Figure()
106-
10799
fig.basemap(projection="x6i", region=[0, 1, 0, 1], frame=True)
108100
fig.legend(specfile.name, position="JTM+jCM+w5i")
109-
110101
return fig
111102

112103

0 commit comments

Comments
 (0)