@@ -782,6 +782,16 @@ 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 (
792
+ expected_cmy , pygame .Color .from_cmy ((0.5 , 0.5 , 0.5 , 0.5 ))
793
+ )
794
+
785
795
def test_from_hsva (self ):
786
796
hsva = pygame .Color .from_hsva (0 , 100 , 100 , 100 )
787
797
hsva_tuple = pygame .Color .from_hsva ((0 , 100 , 100 , 100 ))
@@ -791,6 +801,16 @@ def test_from_hsva(self):
791
801
self .assertEqual (expected_hsva , hsva )
792
802
self .assertEqual (expected_hsva , hsva_tuple )
793
803
804
+ with self .assertWarns (DeprecationWarning ):
805
+ self .assertEqual (
806
+ expected_hsva , pygame .Color .from_hsva (0 , 100 , 100 , 100 , "lel" , "foo" )
807
+ )
808
+
809
+ with self .assertWarns (DeprecationWarning ):
810
+ self .assertEqual (
811
+ expected_hsva , pygame .Color .from_hsva ((0 , 100 , 100 , 100 , "lel" ))
812
+ )
813
+
794
814
def test_from_hsla (self ):
795
815
hsla = pygame .Color .from_hsla (0 , 100 , 100 , 100 )
796
816
hsla_tuple = pygame .Color .from_hsla ((0 , 100 , 100 , 100 ))
@@ -800,6 +820,16 @@ def test_from_hsla(self):
800
820
self .assertEqual (expected_hsla , hsla )
801
821
self .assertEqual (expected_hsla , hsla_tuple )
802
822
823
+ with self .assertWarns (DeprecationWarning ):
824
+ self .assertEqual (
825
+ expected_hsla , pygame .Color .from_hsla (0 , 100 , 100 , 100 , "lel" )
826
+ )
827
+
828
+ with self .assertWarns (DeprecationWarning ):
829
+ self .assertEqual (
830
+ expected_hsla , pygame .Color .from_hsla ((0 , 100 , 100 , 100 , "lel" , "foo" ))
831
+ )
832
+
803
833
def test_from_i1i2i3 (self ):
804
834
i1i2i3 = pygame .Color .from_i1i2i3 (0 , 0 , 0 )
805
835
i1i2i3_tuple = pygame .Color .from_i1i2i3 ((0 , 0 , 0 ))
@@ -809,6 +839,16 @@ def test_from_i1i2i3(self):
809
839
self .assertEqual (expected_i1i2i3 , i1i2i3 )
810
840
self .assertEqual (expected_i1i2i3 , i1i2i3_tuple )
811
841
842
+ with self .assertWarns (DeprecationWarning ):
843
+ self .assertEqual (
844
+ expected_i1i2i3 , pygame .Color .from_i1i2i3 (0 , 0 , 0 , "lel" , "foo" )
845
+ )
846
+
847
+ with self .assertWarns (DeprecationWarning ):
848
+ self .assertEqual (
849
+ expected_i1i2i3 , pygame .Color .from_i1i2i3 ((0 , 0 , 0 , 0 ))
850
+ )
851
+
812
852
def test_normalize (self ):
813
853
c = pygame .Color (204 , 38 , 194 , 55 )
814
854
self .assertEqual (c .r , 204 )
@@ -989,6 +1029,12 @@ def test_cmy__sanity_testing_converted_should_equate_bar_rounding(self):
989
1029
def test_i1i2i3__sanity_testing_converted_should_equate_bar_rounding (self ):
990
1030
self .colorspaces_converted_should_equate_bar_rounding ("i1i2i3" )
991
1031
1032
+ def test_colorspaces_deprecated_large_sequence (self ):
1033
+ c = pygame .Color ("black" )
1034
+ for space in ("hsla" , "hsva" , "i1i2i3" , "cmy" ):
1035
+ with self .assertWarns (DeprecationWarning ):
1036
+ setattr (c , space , (0 , 0 , 0 , 0 , "hehe 5th ignored member" ))
1037
+
992
1038
################################################################################
993
1039
994
1040
def test_correct_gamma__verified_against_python_implementation (self ):
0 commit comments