@@ -122,6 +122,25 @@ def lt(tl):
122
122
123
123
124
124
class TestPlot (object ):
125
+ bytes_data = [
126
+ ['a' , 'b' , 'c' ],
127
+ [b'a' , b'b' , b'c' ],
128
+ np .array ([b'a' , b'b' , b'c' ])
129
+ ]
130
+
131
+ bytes_ids = ['string list' , 'bytes list' , 'bytes ndarray' ]
132
+
133
+ numlike_data = [
134
+ ['1' , '11' , '3' ],
135
+ np .array (['1' , '11' , '3' ]),
136
+ [b'1' , b'11' , b'3' ],
137
+ np .array ([b'1' , b'11' , b'3' ]),
138
+ ]
139
+
140
+ numlike_ids = [
141
+ 'string list' , 'string ndarray' , 'bytes list' , 'bytes ndarray'
142
+ ]
143
+
125
144
@pytest .fixture
126
145
def data (self ):
127
146
self .d = ['a' , 'b' , 'c' , 'a' ]
@@ -176,12 +195,7 @@ def test_plot_1d_missing(self):
176
195
177
196
@cleanup
178
197
@pytest .mark .usefixtures ("data" )
179
- @pytest .mark .parametrize ("bars" ,
180
- [['a' , 'b' , 'c' ],
181
- [b'a' , b'b' , b'c' ],
182
- np .array ([b'a' , b'b' , b'c' ])],
183
- ids = ['string list' , 'bytes list' ,
184
- 'bytes ndarray' ])
198
+ @pytest .mark .parametrize ("bars" , bytes_data , ids = bytes_ids )
185
199
def test_plot_bytes (self , bars ):
186
200
counts = np .array ([4 , 6 , 5 ])
187
201
@@ -192,13 +206,7 @@ def test_plot_bytes(self, bars):
192
206
self .axis_test (ax .xaxis , self .dticks , self .dlabels , self .dunit_data )
193
207
194
208
@cleanup
195
- @pytest .mark .parametrize ("bars" ,
196
- [['1' , '11' , '3' ],
197
- np .array (['1' , '11' , '3' ]),
198
- [b'1' , b'11' , b'3' ],
199
- np .array ([b'1' , b'11' , b'3' ])],
200
- ids = ['string list' , 'string ndarray' ,
201
- 'bytes list' , 'bytes ndarray' ])
209
+ @pytest .mark .parametrize ("bars" , numlike_data , ids = numlike_ids )
202
210
def test_plot_numlike (self , bars ):
203
211
counts = np .array ([4 , 6 , 5 ])
204
212
0 commit comments