diff --git a/Tests/test_font_pcf.py b/Tests/test_font_pcf.py index 815ef1d9254..c217378fb74 100644 --- a/Tests/test_font_pcf.py +++ b/Tests/test_font_pcf.py @@ -82,6 +82,9 @@ def test_textsize(request, tmp_path): assert dy == 20 assert dx in (0, 10) assert font.getlength(chr(i)) == dx + with pytest.warns(DeprecationWarning) as log: + assert font.getsize(chr(i)) == (dx, dy) + assert len(log) == 1 for i in range(len(message)): msg = message[: i + 1] assert font.getlength(msg) == len(msg) * 10 diff --git a/Tests/test_imagefont.py b/Tests/test_imagefont.py index 606b9ba0ed4..16da87d469a 100644 --- a/Tests/test_imagefont.py +++ b/Tests/test_imagefont.py @@ -317,14 +317,16 @@ def test_rotated_transposed_font(self): draw.font = font with pytest.warns(DeprecationWarning) as log: box_size_a = draw.textsize(word) - assert len(log) == 1 + assert box_size_a == font.getsize(word) + assert len(log) == 2 bbox_a = draw.textbbox((10, 10), word) # Rotated font draw.font = transposed_font with pytest.warns(DeprecationWarning) as log: box_size_b = draw.textsize(word) - assert len(log) == 1 + assert box_size_b == transposed_font.getsize(word) + assert len(log) == 2 bbox_b = draw.textbbox((20, 20), word) # Check (w,h) of box a is (h,w) of box b