@@ -97,10 +97,24 @@ def test_combine_cmaps(self, cmaps, nodes):
97
97
98
98
assert combined_cmap .N == 256
99
99
100
- # Test if combining a single colormap raises an error
101
- def test_single_cmap (self ):
102
- with pytest .raises (ValueError , match = "Cannot combine a single colormap." ):
103
- combine_cmaps (cmaps = ["Blues" ])
100
+ # Test if combining less than 2 colormaps triggers an error
101
+ @pytest .mark .parametrize (
102
+ "cmaps" ,
103
+ [
104
+ pytest .param ([], id = "no_cmap" ),
105
+ pytest .param (
106
+ [
107
+ "Blues" ,
108
+ ],
109
+ id = "single_cmap" ,
110
+ ),
111
+ ],
112
+ )
113
+ def test_single_cmap (self , cmaps ):
114
+ with pytest .raises (
115
+ ValueError , match = "Expected at least two colormaps to combine."
116
+ ):
117
+ combine_cmaps (cmaps )
104
118
105
119
# Test if invalid colormap types raise an error
106
120
@pytest .mark .parametrize (
@@ -115,7 +129,12 @@ def test_invalid_cmap_types(self, invalid_cmap):
115
129
combine_cmaps (cmaps = ["Blues" , invalid_cmap ])
116
130
117
131
# Test if invalid nodes types raise an error
118
- @pytest .mark .parametrize ("invalid_nodes" , [0.5 ,],)
132
+ @pytest .mark .parametrize (
133
+ "invalid_nodes" ,
134
+ [
135
+ 0.5 ,
136
+ ],
137
+ )
119
138
def test_invalid_nodes_types (self , invalid_nodes ):
120
139
with pytest .raises (
121
140
TypeError ,
0 commit comments