Skip to content

Commit e24bbd8

Browse files
committed
Fix doctests
1 parent 2cbe6c9 commit e24bbd8

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

pygmt/src/_common.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ def _parse_coastline_resolution(
6060
6161
Returns
6262
-------
63-
str or None
64-
The parsed resolution value.
63+
The parsed single-letter resolution or ``None``.
6564
6665
Raises
6766
------
@@ -71,17 +70,20 @@ def _parse_coastline_resolution(
7170
Examples
7271
--------
7372
>>> _parse_coastline_resolution("full")
74-
"f"
73+
'f'
7574
>>> _parse_coastline_resolution("f")
76-
"f"
75+
'f'
7776
>>> _parse_coastline_resolution("auto", allow_auto=True)
78-
"a"
79-
>>> _parse_coastline_resolution("invalid")
80-
pygmt.exceptions.GMTInvalidInput: Invalid resolution: invalid. Valid values are ...
77+
'a'
8178
>>> _parse_coastline_resolution(None)
82-
None
79+
>>> _parse_coastline_resolution("invalid")
80+
Traceback (most recent call last):
81+
...
82+
pygmt.exceptions.GMTInvalidInput: Invalid resolution: 'invalid'. Valid values ...
8383
>>> _parse_coastline_resolution("auto")
84-
pygmt.exceptions.GMTInvalidInput: Invalid resolution: auto. Valid values are ...
84+
Traceback (most recent call last):
85+
...
86+
pygmt.exceptions.GMTInvalidInput: Invalid resolution: 'auto'. Valid values ...
8587
"""
8688
if resolution is None:
8789
return None
@@ -91,7 +93,7 @@ def _parse_coastline_resolution(
9193
valid_resolutions.add("auto")
9294
if resolution not in {*valid_resolutions, *[res[0] for res in valid_resolutions]}:
9395
msg = (
94-
f"Invalid resolution: {resolution}."
96+
f"Invalid resolution: '{resolution}'. "
9597
f"Valid values are {', '.join(valid_resolutions)}."
9698
)
9799
raise GMTInvalidInput(msg)

0 commit comments

Comments
 (0)