Skip to content

Commit 781e516

Browse files
authored
check_figures_equal: Initialize fig_ref and fig_test to avoid UnboundLocalError when crashes (#3436)
1 parent 98e2f6a commit 781e516

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pygmt/helpers/testing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def wrapper(*args, ext="png", request=None, **kwargs):
8989
file_name = "".join(c for c in request.node.name if c in allowed_chars)
9090
except AttributeError: # 'NoneType' object has no attribute 'node'
9191
file_name = func.__name__
92+
93+
fig_ref, fig_test = None, None
9294
try:
9395
fig_ref, fig_test = func(*args, **kwargs)
9496
ref_image_path = Path(result_dir) / f"{file_name}-expected.{ext}"

0 commit comments

Comments
 (0)