Skip to content

Commit 8c34683

Browse files
committed
Add a test for PS_CHAR_ENCODING=Standard+
1 parent 763dc07 commit 8c34683

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pygmt/tests/test_text.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import numpy as np
88
import pytest
9-
from pygmt import Figure
9+
from pygmt import Figure, config
1010
from pygmt.exceptions import GMTCLibError, GMTInvalidInput
1111
from pygmt.helpers import GMTTempFile
1212

@@ -410,12 +410,17 @@ def test_text_nonstr_text():
410410
return fig
411411

412412

413-
@pytest.mark.mpl_image_compare
414-
def test_text_nonascii():
413+
@pytest.mark.mpl_image_compare(filename="test_text_nonascii.png")
414+
@pytest.mark.parametrize("encoding", ["ISOLatin1+", "Standard+"])
415+
def test_text_nonascii(encoding):
415416
"""
416417
Test passing text strings with non-ascii characters.
418+
419+
Default PS_CHAR_ENCODING setting should not affect the result.
417420
"""
418421
fig = Figure()
422+
if encoding == "Standard+": # Temporarily set the PS_CHAR_ENCODING to "Standard+".
423+
config(PS_CHAR_ENCODING="Standard+")
419424
fig.basemap(region=[0, 10, 0, 10], projection="X10c", frame=True)
420425
fig.text(position="TL", text="position-text:°α") # noqa: RUF001
421426
fig.text(x=1, y=1, text="xytext:°α") # noqa: RUF001

0 commit comments

Comments
 (0)