From f586adefd7880a102349ec642d4247b827341109 Mon Sep 17 00:00:00 2001 From: hugovk Date: Wed, 4 Oct 2017 09:54:53 +0300 Subject: [PATCH] Failing test for #2783 --- Tests/test_imagedraw.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Tests/test_imagedraw.py b/Tests/test_imagedraw.py index e4bcb9faa..a79a75ca0 100644 --- a/Tests/test_imagedraw.py +++ b/Tests/test_imagedraw.py @@ -380,7 +380,6 @@ class TestImageDraw(PillowTestCase): self.assert_image_equal( im, Image.open("Tests/images/imagedraw_floodfill2.png")) - def test_floodfill_thresh(self): # floodfill() is experimental @@ -560,6 +559,19 @@ class TestImageDraw(PillowTestCase): # Assert self.assert_image_similar(im, Image.open(expected), 1) + def test_textsize_empty_string(self): + # https://github.com/python-pillow/Pillow/issues/2783 + # Arrange + im = Image.new("RGB", (W, H)) + draw = ImageDraw.Draw(im) + + # Act + # Should not cause 'SystemError: returned NULL without setting an error' + draw.textsize("") + draw.textsize("\n") + draw.textsize("test\n") + if __name__ == '__main__': unittest.main()