mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-01 00:17:27 +03:00 
			
		
		
		
	Convert assert into exception
This commit is contained in:
		
							parent
							
								
									fc8717fb04
								
							
						
					
					
						commit
						d7e4d3db3f
					
				|  | @ -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): | ||||
|  |  | |||
|  | @ -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 | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user