Skip to content

Commit ceb5773

Browse files
committed
Fix test_size to make it more lax
1 parent a8372fc commit ceb5773

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/font_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,10 @@ def test_size(self):
617617

618618
self.assertIsInstance(w, int)
619619
self.assertIsInstance(h, int)
620-
self.assertEqual(s.get_size(), size)
620+
621+
# test width and height match, with a tolerance for 1 pixel errors
622+
self.assertTrue(w - 1 <= s.get_width() <= w + 1)
623+
self.assertTrue(h - 1 <= s.get_height() <= h + 1)
621624
self.assertEqual(f.size(btext), size)
622625

623626
text = "\u212a"

0 commit comments

Comments
 (0)