@@ -2870,7 +2870,7 @@ def test_to_surface__area_output(self):
28702870 [{"dest" : (1 , 0 ), "area" : (0 , 0 , 1 , 2 )}, [[black , white ], [black , white ]]],
28712871 [{"dest" : (0 , 0 ), "area" : (0 , 0 , 0 , 0 )}, [[black , black ], [black , black ]]],
28722872 [{"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 ]]],
28742874 [
28752875 {"dest" : (1 , 1 ), "area" : (- 2 , - 2 , 1 , 1 )},
28762876 [[black , black ], [black , black ]],
@@ -2881,16 +2881,16 @@ def test_to_surface__area_output(self):
28812881 ],
28822882 [
28832883 {"dest" : (- 1 , 0 ), "area" : (- 1 , 0 , 2 , 2 )},
2884- [[white , black ], [white , black ]],
2884+ [[black , black ], [black , black ]],
28852885 ],
28862886 [
28872887 {"dest" : (0 , - 1 ), "area" : (- 1 , 0 , 3 , 2 )},
2888- [[black , white ], [black , black ]],
2888+ [[white , white ], [black , black ]],
28892889 ],
28902890 [{"dest" : (0 , 0 ), "area" : (2 , 2 , 2 , 2 )}, [[black , black ], [black , black ]]],
28912891 [
28922892 {"dest" : (- 5 , - 5 ), "area" : (- 5 , - 5 , 6 , 6 )},
2893- [[white , black ], [black , black ]],
2893+ [[black , black ], [black , black ]],
28942894 ],
28952895 [
28962896 {"dest" : (- 5 , - 5 ), "area" : (- 5 , - 5 , 1 , 1 )},
@@ -4550,12 +4550,12 @@ def test_to_surface__dest_locations(self):
45504550 default_setcolor = pygame .Color ("white" )
45514551 default_unsetcolor = pygame .Color ("black" )
45524552
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+ ]
45594559
45604560 for fill in (True , False ):
45614561 mask = pygame .mask .Mask ((SIDE , SIDE ), fill = fill )
@@ -4583,12 +4583,12 @@ def test_to_surface__area_locations(self):
45834583 default_setcolor = pygame .Color ("white" )
45844584 default_unsetcolor = pygame .Color ("black" )
45854585
4586- directions = (
4586+ directions = [
45874587 [(s , 0 ) for s in range (- SIDE , SIDE + 1 )], # left to right
45884588 [(0 , s ) for s in range (- SIDE , SIDE + 1 )], # top to bottom
45894589 [(s , s ) for s in range (- SIDE , SIDE + 1 )], # topleft to bottomright diag
45904590 [(- s , s ) for s in range (- SIDE , SIDE + 1 )], # topright to bottomleft diag
4591- )
4591+ ]
45924592
45934593 for fill in (True , False ):
45944594 mask = pygame .mask .Mask ((SIDE , SIDE ), fill = fill )
@@ -4623,16 +4623,16 @@ def test_to_surface__dest_and_area_locations(self):
46234623 default_setcolor = pygame .Color ("white" )
46244624 default_unsetcolor = pygame .Color ("black" )
46254625
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+ ]
46324632
46334633 # Using only the topleft to bottomright diagonal to test the area (to
46344634 # reduce the number of loop iterations).
4635- area_positions = list ( dest_directions [2 ])
4635+ area_positions = dest_directions [2 ]
46364636
46374637 for fill in (True , False ):
46384638 mask = pygame .mask .Mask ((SIDE , SIDE ), fill = fill )
@@ -5145,17 +5145,14 @@ def test_to_surface__area_on_mask(self):
51455145 overlap_rect = mask_rect .clip (area_rect )
51465146 overlap_rect .topleft = (0 , 0 )
51475147
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 )
51525149
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+ )
51595156
51605157 def test_to_surface__area_on_mask_with_setsurface_unsetsurface (self ):
51615158 """Ensures area values on the mask work correctly
0 commit comments