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