Skip to content

Commit e166564

Browse files
committed
Update documentation on check_figures_equal
1 parent 52b7d40 commit e166564

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,8 @@ Here's an example:
328328
@check_figures_equal()
329329
def test_my_plotting_case():
330330
"Test that my plotting function works"
331-
fig_ref = Figure()
331+
fig_ref, fig_test = Figure(), Figure()
332332
fig_ref.grdimage("@earth_relief_01d_g", projection="W120/15c", cmap="geo")
333-
fig_test = Figure()
334333
fig_test.grdimage(grid, projection="W120/15c", cmap="geo")
335334
return fig_ref, fig_test
336335
```

pygmt/helpers/testing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ def check_figures_equal(*, extensions=("png",), tol=0.0, result_dir="result_imag
1515
"""
1616
Decorator for test cases that generate and compare two figures.
1717
18-
The decorated function must take two arguments, *fig_ref* and *fig_test*,
19-
and draw the reference and test images on them. After the function
20-
returns, the figures are saved and compared.
18+
The decorated function must return two arguments, *fig_ref* and *fig_test*,
19+
these two figures will then be saved and compared against each other.
2120
2221
This decorator is practically identical to matplotlib's check_figures_equal
2322
function, but adapted for PyGMT figures. See also the original code at

0 commit comments

Comments
 (0)