@@ -1170,15 +1170,12 @@ def test_highlight_quantile(self, kwargs):
1170
1170
assert result == expected
1171
1171
1172
1172
@pytest .mark .parametrize (
1173
- "f" ,
1173
+ "f,kwargs " ,
1174
1174
[
1175
- {"f" : "highlight_min" , "kw" : {"axis" : 1 , "subset" : pd .IndexSlice [1 , :]}},
1176
- {"f" : "highlight_max" , "kw" : {"axis" : 0 , "subset" : [0 ]}},
1177
- {
1178
- "f" : "highlight_quantile" ,
1179
- "kw" : {"axis" : None , "q_low" : 0.6 , "q_high" : 0.8 },
1180
- },
1181
- {"f" : "highlight_range" , "kw" : {"subset" : [0 ]}},
1175
+ ("highlight_min" , {"axis" : 1 , "subset" : pd .IndexSlice [1 , :]}),
1176
+ ("highlight_max" , {"axis" : 0 , "subset" : [0 ]}),
1177
+ ("highlight_quantile" , {"axis" : None , "q_low" : 0.6 , "q_high" : 0.8 }),
1178
+ ("highlight_range" , {"subset" : [0 ]}),
1182
1179
],
1183
1180
)
1184
1181
@pytest .mark .parametrize (
@@ -1191,15 +1188,14 @@ def test_highlight_quantile(self, kwargs):
1191
1188
DataFrame ([[0 , 1 ], [2 , 3 ]], dtype = "timedelta64[ns]" ),
1192
1189
],
1193
1190
)
1194
- def test_all_highlight_dtypes (self , f , df ):
1195
- func = f ["f" ]
1196
- if func == "highlight_quantile" and isinstance (df .iloc [0 , 0 ], str ):
1191
+ def test_all_highlight_dtypes (self , f , kwargs , df ):
1192
+ if f == "highlight_quantile" and isinstance (df .iloc [0 , 0 ], str ):
1197
1193
return None # quantile incompatible with str
1198
- elif func == "highlight_range" :
1199
- f [ "kw" ] ["start" ] = df .iloc [1 , 0 ] # set the range low for testing
1194
+ elif f == "highlight_range" :
1195
+ kwargs ["start" ] = df .iloc [1 , 0 ] # set the range low for testing
1200
1196
1201
1197
expected = {(1 , 0 ): [("background-color" , "yellow" )]}
1202
- result = getattr (df .style , func )(** f [ "kw" ] )._compute ().ctx
1198
+ result = getattr (df .style , f )(** kwargs )._compute ().ctx
1203
1199
assert result == expected
1204
1200
1205
1201
def test_export (self ):
0 commit comments