Skip to content

Commit

Permalink
Fix doctest failures on helpers/testing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
weiji14 committed Sep 11, 2020
1 parent 406f847 commit cbaed26
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pygmt/helpers/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,16 @@ def decorator(func):
old_sig = inspect.signature(func)

@pytest.mark.parametrize("ext", extensions)
def wrapper(*args, ext, request, **kwargs):
def wrapper(*args, ext="png", request=None, **kwargs):
if "ext" in old_sig.parameters:
kwargs["ext"] = ext
if "request" in old_sig.parameters:
kwargs["request"] = request

file_name = "".join(c for c in request.node.name if c in ALLOWED_CHARS)
try:
file_name = "".join(c for c in request.node.name if c in ALLOWED_CHARS)
except AttributeError: #'NoneType' object has no attribute 'node'
raise
file_name = func.__name__
try:
fig_ref, fig_test = func(*args, **kwargs)
ref_image_path = os.path.join(result_dir, f"{file_name}-expected.{ext}")
Expand Down

0 comments on commit cbaed26

Please sign in to comment.