Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite0fe354

Browse files
committed
Convert ft2font extension to pybind11
1 parentcb9cf3b commite0fe354

File tree

3 files changed

+647
-1036
lines changed

3 files changed

+647
-1036
lines changed

‎lib/matplotlib/tests/test_ft2font.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def test_ft2font_invalid_args(tmp_path):
130130
# filename argument.
131131
withpytest.raises(TypeError,match='to a font file or a binary-mode file object'):
132132
ft2font.FT2Font(None)
133+
withpytest.raises(TypeError,match='to a font file or a binary-mode file object'):
134+
ft2font.FT2Font(object())# Not bytes or string, and has no read() method.
133135
file=tmp_path/'invalid-font.ttf'
134136
file.write_text('This is not a valid font file.')
135137
with (pytest.raises(TypeError,match='to a font file or a binary-mode file object'),
@@ -145,7 +147,7 @@ def test_ft2font_invalid_args(tmp_path):
145147
file=fm.findfont('DejaVu Sans')
146148

147149
# hinting_factor argument.
148-
withpytest.raises(TypeError,match='cannot be interpreted as an integer'):
150+
withpytest.raises(TypeError,match='incompatible constructor arguments'):
149151
ft2font.FT2Font(file,1.3)
150152
withpytest.raises(ValueError,match='hinting_factor must be greater than 0'):
151153
ft2font.FT2Font(file,0)
@@ -157,7 +159,7 @@ def test_ft2font_invalid_args(tmp_path):
157159
ft2font.FT2Font(file,_fallback_list=[0])# type: ignore[list-item]
158160

159161
# kerning_factor argument.
160-
withpytest.raises(TypeError,match='cannot be interpreted as an integer'):
162+
withpytest.raises(TypeError,match='incompatible constructor arguments'):
161163
ft2font.FT2Font(file,_kerning_factor=1.3)
162164

163165

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp