Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 343f5fc

Browse files
committed
TST afm._to_str is now tested against utf8-encoded bytes
1 parent ce92859 commit 343f5fc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

lib/matplotlib/tests/test_afm.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import matplotlib.afm as afm
2+
import six
3+
4+
5+
def test_nonascii_str():
6+
# This tests that we also decode bytes as utf-8 properly.
7+
# Else, font files with non ascii caracters fail to load.
8+
9+
if six.PY3:
10+
string = "привет".encode("utf8")
11+
else:
12+
string = "привет"
13+
afm._to_str(string)

0 commit comments

Comments
 (0)