@@ -2870,7 +2870,7 @@ def test_to_surface__area_output(self):
2870
2870
[{"dest" : (1 , 0 ), "area" : (0 , 0 , 1 , 2 )}, [[black , white ], [black , white ]]],
2871
2871
[{"dest" : (0 , 0 ), "area" : (0 , 0 , 0 , 0 )}, [[black , black ], [black , black ]]],
2872
2872
[{"dest" : (1 , 0 ), "area" : (- 1 , 0 , 1 , 1 )}, [[black , black ], [black , black ]]],
2873
- [{"dest" : (0 , 0 ), "area" : (- 1 , 0 , 2 , 1 )}, [[black , white ], [black , black ]]],
2873
+ [{"dest" : (0 , 0 ), "area" : (- 1 , 0 , 2 , 1 )}, [[white , black ], [black , black ]]],
2874
2874
[
2875
2875
{"dest" : (1 , 1 ), "area" : (- 2 , - 2 , 1 , 1 )},
2876
2876
[[black , black ], [black , black ]],
@@ -2881,16 +2881,16 @@ def test_to_surface__area_output(self):
2881
2881
],
2882
2882
[
2883
2883
{"dest" : (- 1 , 0 ), "area" : (- 1 , 0 , 2 , 2 )},
2884
- [[white , black ], [white , black ]],
2884
+ [[black , black ], [black , black ]],
2885
2885
],
2886
2886
[
2887
2887
{"dest" : (0 , - 1 ), "area" : (- 1 , 0 , 3 , 2 )},
2888
- [[black , white ], [black , black ]],
2888
+ [[white , white ], [black , black ]],
2889
2889
],
2890
2890
[{"dest" : (0 , 0 ), "area" : (2 , 2 , 2 , 2 )}, [[black , black ], [black , black ]]],
2891
2891
[
2892
2892
{"dest" : (- 5 , - 5 ), "area" : (- 5 , - 5 , 6 , 6 )},
2893
- [[white , black ], [black , black ]],
2893
+ [[black , black ], [black , black ]],
2894
2894
],
2895
2895
[
2896
2896
{"dest" : (- 5 , - 5 ), "area" : (- 5 , - 5 , 1 , 1 )},
@@ -4550,12 +4550,12 @@ def test_to_surface__dest_locations(self):
4550
4550
default_setcolor = pygame .Color ("white" )
4551
4551
default_unsetcolor = pygame .Color ("black" )
4552
4552
4553
- directions = (
4554
- (( s , 0 ) for s in range (- SIDE , SIDE + 1 )) , # left to right
4555
- (( 0 , s ) for s in range (- SIDE , SIDE + 1 )) , # top to bottom
4556
- (( s , s ) for s in range (- SIDE , SIDE + 1 )) , # topleft to bottomright diag
4557
- (( - s , s ) for s in range (- SIDE , SIDE + 1 )) , # topright to bottomleft diag
4558
- )
4553
+ directions = [
4554
+ [( s , 0 ) for s in range (- SIDE , SIDE + 1 )] , # left to right
4555
+ [( 0 , s ) for s in range (- SIDE , SIDE + 1 )] , # top to bottom
4556
+ [( s , s ) for s in range (- SIDE , SIDE + 1 )] , # topleft to bottomright diag
4557
+ [( - s , s ) for s in range (- SIDE , SIDE + 1 )] , # topright to bottomleft diag
4558
+ ]
4559
4559
4560
4560
for fill in (True , False ):
4561
4561
mask = pygame .mask .Mask ((SIDE , SIDE ), fill = fill )
@@ -4583,12 +4583,12 @@ def test_to_surface__area_locations(self):
4583
4583
default_setcolor = pygame .Color ("white" )
4584
4584
default_unsetcolor = pygame .Color ("black" )
4585
4585
4586
- directions = (
4586
+ directions = [
4587
4587
[(s , 0 ) for s in range (- SIDE , SIDE + 1 )], # left to right
4588
4588
[(0 , s ) for s in range (- SIDE , SIDE + 1 )], # top to bottom
4589
4589
[(s , s ) for s in range (- SIDE , SIDE + 1 )], # topleft to bottomright diag
4590
4590
[(- s , s ) for s in range (- SIDE , SIDE + 1 )], # topright to bottomleft diag
4591
- )
4591
+ ]
4592
4592
4593
4593
for fill in (True , False ):
4594
4594
mask = pygame .mask .Mask ((SIDE , SIDE ), fill = fill )
@@ -4623,16 +4623,16 @@ def test_to_surface__dest_and_area_locations(self):
4623
4623
default_setcolor = pygame .Color ("white" )
4624
4624
default_unsetcolor = pygame .Color ("black" )
4625
4625
4626
- dest_directions = (
4627
- (( s , 0 ) for s in range (- SIDE , SIDE + 1 )) , # left to right
4628
- (( 0 , s ) for s in range (- SIDE , SIDE + 1 )) , # top to bottom
4629
- (( s , s ) for s in range (- SIDE , SIDE + 1 )) , # topleft to bottomright diag
4630
- (( - s , s ) for s in range (- SIDE , SIDE + 1 )) , # topright to bottomleft diag
4631
- )
4626
+ dest_directions = [
4627
+ [( s , 0 ) for s in range (- SIDE , SIDE + 1 )] , # left to right
4628
+ [( 0 , s ) for s in range (- SIDE , SIDE + 1 )] , # top to bottom
4629
+ [( s , s ) for s in range (- SIDE , SIDE + 1 )] , # topleft to bottomright diag
4630
+ [( - s , s ) for s in range (- SIDE , SIDE + 1 )] , # topright to bottomleft diag
4631
+ ]
4632
4632
4633
4633
# Using only the topleft to bottomright diagonal to test the area (to
4634
4634
# reduce the number of loop iterations).
4635
- area_positions = list ( dest_directions [2 ])
4635
+ area_positions = dest_directions [2 ]
4636
4636
4637
4637
for fill in (True , False ):
4638
4638
mask = pygame .mask .Mask ((SIDE , SIDE ), fill = fill )
@@ -5145,17 +5145,14 @@ def test_to_surface__area_on_mask(self):
5145
5145
overlap_rect = mask_rect .clip (area_rect )
5146
5146
overlap_rect .topleft = (0 , 0 )
5147
5147
5148
- with self .subTest (
5149
- pos = pos , area_rect = area_rect .copy (), overlap_rect = overlap_rect
5150
- ):
5151
- to_surface = mask .to_surface (surface , area = area_rect )
5148
+ to_surface = mask .to_surface (surface , area = area_rect )
5152
5149
5153
- self .assertIs (to_surface , surface )
5154
- self .assertEqual (to_surface .get_size (), size )
5155
- assertSurfaceFilled (self , to_surface , expected_color , overlap_rect )
5156
- assertSurfaceFilledIgnoreArea (
5157
- self , to_surface , surface_color , overlap_rect
5158
- )
5150
+ self .assertIs (to_surface , surface )
5151
+ self .assertEqual (to_surface .get_size (), size )
5152
+ assertSurfaceFilled (self , to_surface , expected_color , overlap_rect )
5153
+ assertSurfaceFilledIgnoreArea (
5154
+ self , to_surface , surface_color , overlap_rect
5155
+ )
5159
5156
5160
5157
def test_to_surface__area_on_mask_with_setsurface_unsetsurface (self ):
5161
5158
"""Ensures area values on the mask work correctly
0 commit comments