(name, size, skippable)
| 206 | @pytest.mark.parametrize('name, size, skippable', |
| 207 | [('DejaVu Sans', 1, False), ('WenQuanYi Zen Hei', 3, True)]) |
| 208 | def test_ft2font_face_index(name, size, skippable): |
| 209 | try: |
| 210 | file = fm.findfont(name, fallback_to_default=False) |
| 211 | except ValueError: |
| 212 | if skippable: |
| 213 | pytest.skip(r'Font {name} may be missing') |
| 214 | raise |
| 215 | for index in range(size): |
| 216 | font = ft2font.FT2Font(file, face_index=index) |
| 217 | assert font.num_faces >= size |
| 218 | assert font.face_index == index |
| 219 | with pytest.raises(ValueError, match='must be between'): # out of bounds for spec |
| 220 | ft2font.FT2Font(file, face_index=0x1ffff) |
| 221 | with pytest.raises(RuntimeError, match='invalid argument'): # invalid for this font |
| 222 | ft2font.FT2Font(file, face_index=0xff) |
| 223 | |
| 224 | |
| 225 | def test_ft2font_clear(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…