Convert assert into exception

This commit is contained in:
Hugo 2018-07-04 16:47:48 +03:00
parent fc8717fb04
commit d7e4d3db3f
2 changed files with 2 additions and 2 deletions

View File

@ -215,7 +215,7 @@ class TestImageFont(PillowTestCase):
# Act/Assert
self.assertRaises(
AssertionError,
ValueError,
draw.multiline_text, (0, 0), TEST_TEXT, font=ttf, align="unknown")
def test_draw_align(self):

View File

@ -246,7 +246,7 @@ class ImageDraw(object):
elif align == "right":
left += (max_width - widths[idx])
else:
assert False, 'align must be "left", "center" or "right"'
raise ValueError('align must be "left", "center" or "right"')
self.text((left, top), line, fill, font, anchor,
direction=direction, features=features)
top += line_spacing