@@ -104,9 +104,9 @@ def test_convert_color_fail():
104104 with pytest .raises (KeyError ):
105105 convert (chart_spec )
106106
107- @pytest .mark .parametrize ('channel' , ['quant' , 'ord' ])
108- def test_convert_fill (channel ):
109- chart_spec = alt .Chart (df ).encode (fill = channel ).mark_point ()
107+ @pytest .mark .parametrize ('channel,type ' , [( 'quant' , 'Q' ), ( ' ord', 'O' ) ])
108+ def test_convert_fill (channel , type ):
109+ chart_spec = alt .Chart (df ).encode (fill = '{}:{}' . format ( channel , type ) ).mark_point ()
110110 mapping = convert (chart_spec )
111111 assert list (mapping ['c' ]) == list (df [channel ].values )
112112
@@ -121,6 +121,7 @@ def test_convert_fill_success_temporal(column):
121121 mapping = convert (chart )
122122 assert list (mapping ['c' ]) == list (mdates .date2num (df [column ].values ))
123123
124+
124125def test_convert_fill_fail ():
125126 chart_spec = alt .Chart (df ).encode (fill = 'b:N' ).mark_point ()
126127 with pytest .raises (KeyError ):
@@ -156,9 +157,9 @@ def test_convert_opacity_fail_temporal(column):
156157 chart = alt .Chart (df ).mark_point ().encode (alt .Opacity (column ))
157158 convert (chart )
158159
159- @pytest .mark .parametrize ('channel,dtype ' , [('quant' ,'quantitative ' ), ('ord' , 'ordinal ' )])
160- def test_convert_size_success (channel , dtype ):
161- chart_spec = alt .Chart (df ).encode (size = alt . Size ( field = channel , type = dtype )).mark_point ()
160+ @pytest .mark .parametrize ('channel,type ' , [('quant' , 'Q ' ), ('ord' , 'O ' )])
161+ def test_convert_size_success (channel , type ):
162+ chart_spec = alt .Chart (df ).encode (size = '{}:{}' . format ( channel , type )).mark_point ()
162163 mapping = convert (chart_spec )
163164 assert list (mapping ['s' ]) == list (df [channel ].values )
164165
0 commit comments