@@ -782,6 +782,14 @@ def test_from_cmy(self):
782
782
self .assertEqual (expected_cmy , cmy )
783
783
self .assertEqual (expected_cmy , cmy_tuple )
784
784
785
+ with self .assertWarns (DeprecationWarning ):
786
+ self .assertEqual (
787
+ expected_cmy , pygame .Color .from_cmy (0.5 , 0.5 , 0.5 , "lel" , "foo" )
788
+ )
789
+
790
+ with self .assertWarns (DeprecationWarning ):
791
+ self .assertEqual (expected_cmy , pygame .Color .from_cmy ((0.5 , 0.5 , 0.5 , 0.5 )))
792
+
785
793
def test_from_hsva (self ):
786
794
hsva = pygame .Color .from_hsva (0 , 100 , 100 , 100 )
787
795
hsva_tuple = pygame .Color .from_hsva ((0 , 100 , 100 , 100 ))
@@ -791,6 +799,16 @@ def test_from_hsva(self):
791
799
self .assertEqual (expected_hsva , hsva )
792
800
self .assertEqual (expected_hsva , hsva_tuple )
793
801
802
+ with self .assertWarns (DeprecationWarning ):
803
+ self .assertEqual (
804
+ expected_hsva , pygame .Color .from_hsva (0 , 100 , 100 , 100 , "lel" , "foo" )
805
+ )
806
+
807
+ with self .assertWarns (DeprecationWarning ):
808
+ self .assertEqual (
809
+ expected_hsva , pygame .Color .from_hsva ((0 , 100 , 100 , 100 , "lel" ))
810
+ )
811
+
794
812
def test_from_hsla (self ):
795
813
hsla = pygame .Color .from_hsla (0 , 100 , 100 , 100 )
796
814
hsla_tuple = pygame .Color .from_hsla ((0 , 100 , 100 , 100 ))
@@ -800,6 +818,16 @@ def test_from_hsla(self):
800
818
self .assertEqual (expected_hsla , hsla )
801
819
self .assertEqual (expected_hsla , hsla_tuple )
802
820
821
+ with self .assertWarns (DeprecationWarning ):
822
+ self .assertEqual (
823
+ expected_hsla , pygame .Color .from_hsla (0 , 100 , 100 , 100 , "lel" )
824
+ )
825
+
826
+ with self .assertWarns (DeprecationWarning ):
827
+ self .assertEqual (
828
+ expected_hsla , pygame .Color .from_hsla ((0 , 100 , 100 , 100 , "lel" , "foo" ))
829
+ )
830
+
803
831
def test_from_i1i2i3 (self ):
804
832
i1i2i3 = pygame .Color .from_i1i2i3 (0 , 0 , 0 )
805
833
i1i2i3_tuple = pygame .Color .from_i1i2i3 ((0 , 0 , 0 ))
@@ -809,6 +837,14 @@ def test_from_i1i2i3(self):
809
837
self .assertEqual (expected_i1i2i3 , i1i2i3 )
810
838
self .assertEqual (expected_i1i2i3 , i1i2i3_tuple )
811
839
840
+ with self .assertWarns (DeprecationWarning ):
841
+ self .assertEqual (
842
+ expected_i1i2i3 , pygame .Color .from_i1i2i3 (0 , 0 , 0 , "lel" , "foo" )
843
+ )
844
+
845
+ with self .assertWarns (DeprecationWarning ):
846
+ self .assertEqual (expected_i1i2i3 , pygame .Color .from_i1i2i3 ((0 , 0 , 0 , 0 )))
847
+
812
848
def test_normalize (self ):
813
849
c = pygame .Color (204 , 38 , 194 , 55 )
814
850
self .assertEqual (c .r , 204 )
@@ -989,6 +1025,12 @@ def test_cmy__sanity_testing_converted_should_equate_bar_rounding(self):
989
1025
def test_i1i2i3__sanity_testing_converted_should_equate_bar_rounding (self ):
990
1026
self .colorspaces_converted_should_equate_bar_rounding ("i1i2i3" )
991
1027
1028
+ def test_colorspaces_deprecated_large_sequence (self ):
1029
+ c = pygame .Color ("black" )
1030
+ for space in ("hsla" , "hsva" , "i1i2i3" , "cmy" ):
1031
+ with self .assertWarns (DeprecationWarning ):
1032
+ setattr (c , space , (0 , 0 , 0 , 0 , "hehe 5th ignored member" ))
1033
+
992
1034
################################################################################
993
1035
994
1036
def test_correct_gamma__verified_against_python_implementation (self ):
0 commit comments