@@ -448,6 +448,7 @@ def test_shape1() -> None:
448
448
x3 , y3 = 95 , 5
449
449
450
450
# Act
451
+ assert ImageDraw .Outline is not None
451
452
s = ImageDraw .Outline ()
452
453
s .move (x0 , y0 )
453
454
s .curve (x1 , y1 , x2 , y2 , x3 , y3 )
@@ -469,6 +470,7 @@ def test_shape2() -> None:
469
470
x3 , y3 = 5 , 95
470
471
471
472
# Act
473
+ assert ImageDraw .Outline is not None
472
474
s = ImageDraw .Outline ()
473
475
s .move (x0 , y0 )
474
476
s .curve (x1 , y1 , x2 , y2 , x3 , y3 )
@@ -487,6 +489,7 @@ def test_transform() -> None:
487
489
draw = ImageDraw .Draw (im )
488
490
489
491
# Act
492
+ assert ImageDraw .Outline is not None
490
493
s = ImageDraw .Outline ()
491
494
s .line (0 , 0 )
492
495
s .transform ((0 , 0 , 0 , 0 , 0 , 0 ))
@@ -913,7 +916,12 @@ def test_rounded_rectangle_translucent(
913
916
def test_floodfill (bbox : Coords ) -> None :
914
917
red = ImageColor .getrgb ("red" )
915
918
916
- for mode , value in [("L" , 1 ), ("RGBA" , (255 , 0 , 0 , 0 )), ("RGB" , red )]:
919
+ mode_values : list [tuple [str , int | tuple [int , ...]]] = [
920
+ ("L" , 1 ),
921
+ ("RGBA" , (255 , 0 , 0 , 0 )),
922
+ ("RGB" , red ),
923
+ ]
924
+ for mode , value in mode_values :
917
925
# Arrange
918
926
im = Image .new (mode , (W , H ))
919
927
draw = ImageDraw .Draw (im )
@@ -1429,6 +1437,7 @@ def test_same_color_outline(bbox: Coords) -> None:
1429
1437
x2 , y2 = 95 , 50
1430
1438
x3 , y3 = 95 , 5
1431
1439
1440
+ assert ImageDraw .Outline is not None
1432
1441
s = ImageDraw .Outline ()
1433
1442
s .move (x0 , y0 )
1434
1443
s .curve (x1 , y1 , x2 , y2 , x3 , y3 )
@@ -1467,7 +1476,7 @@ def test_same_color_outline(bbox: Coords) -> None:
1467
1476
(4 , "square" , {}),
1468
1477
(8 , "regular_octagon" , {}),
1469
1478
(4 , "square_rotate_45" , {"rotation" : 45 }),
1470
- (3 , "triangle_width" , {"width " : 5 , "outline " : "yellow" }),
1479
+ (3 , "triangle_width" , {"outline " : "yellow" , "width " : 5 }),
1471
1480
],
1472
1481
)
1473
1482
def test_draw_regular_polygon (
@@ -1477,7 +1486,10 @@ def test_draw_regular_polygon(
1477
1486
filename = f"Tests/images/imagedraw_{ polygon_name } .png"
1478
1487
draw = ImageDraw .Draw (im )
1479
1488
bounding_circle = ((W // 2 , H // 2 ), 25 )
1480
- draw .regular_polygon (bounding_circle , n_sides , fill = "red" , ** args )
1489
+ rotation = int (args .get ("rotation" , 0 ))
1490
+ outline = args .get ("outline" )
1491
+ width = int (args .get ("width" , 1 ))
1492
+ draw .regular_polygon (bounding_circle , n_sides , rotation , "red" , outline , width )
1481
1493
assert_image_equal_tofile (im , filename )
1482
1494
1483
1495
@@ -1630,6 +1642,6 @@ def test_incorrectly_ordered_coordinates(xy: tuple[int, int, int, int]) -> None:
1630
1642
draw .rounded_rectangle (xy )
1631
1643
1632
1644
1633
- def test_getdraw ():
1645
+ def test_getdraw () -> None :
1634
1646
with pytest .warns (DeprecationWarning ):
1635
1647
ImageDraw .getdraw (None , [])
0 commit comments