Skip to content

Commit d3f4f83

Browse files
Tighten test
1 parent af3aee1 commit d3f4f83

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/test_graphical_font_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ def test_getfont_ttf_with_emoji(self):
116116

117117
def test_getfont_missing_ttf_raises(self):
118118
"""A missing TTF path should raise instead of silently falling back."""
119-
with self.assertRaises(Exception):
119+
with self.assertRaises(OSError) as cm:
120120
FontManager.getFont(size=24, ttf="M:../tests/DOES_NOT_EXIST.ttf", emoji=False)
121+
self.assertIn("TTF file not found", str(cm.exception))
121122

122123
def test_getfont_unscii_family(self):
123124
"""Unscii family is available and returns a usable font."""

0 commit comments

Comments
 (0)