8000 TST : modified tests to pass · matplotlib/matplotlib@6bcffbe · GitHub
[go: up one dir, main page]

Skip to content

Commit 6bcffbe

Browse files
committed
TST : modified tests to pass
- added check that labels don't get adding by default
1 parent 2775a7f commit 6bcffbe

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/matplotlib/tests/test_cbook.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ def setup(self):
121121
'q1': 1.3597529879465153,
122122
'q3': 14.85246294739361,
123123
'whishi': 27.899688243699629,
124-
'whislo': 0.042143774965502923,
125-
'label': 1
124+
'whislo': 0.042143774965502923
126125
}
127126

128127
self.known_bootstrapped_ci = {
@@ -136,10 +135,6 @@ def setup(self):
136135
'fliers': np.array([92.55467075, 87.03819018]),
137136
}
138137

139-
self.known_res_with_labels = {
140-
'label': 'Test1'
141-
}
142-
143138
self.known_res_percentiles = {
144139
'whislo': 0.1933685896907924,
145140
'whishi': 42.232049135969874
@@ -229,11 +224,15 @@ def test_results_whiskers_percentiles(self):
229224
)
230225

231226
def test_results_withlabels(self):
232-
labels = ['Test1', 2, 3, 4]
227+
labels = ['Test1', 2, 'ardvark', 4]
233228
results = cbook.boxplot_stats(self.data, labels=labels)
234229
res = results[0]
235-
for key in list(self.known_res_with_labels.keys()):
236-
assert_equal(res[key], self.known_res_with_labels[key])
230+
for lab, res in zip(labels, results):
231+
assert_equal(res['label'], lab)
232+
233+
results = cbook.boxplot_stats(self.data)
234+
for res in results:
235+
assert('label' not in res)
237236

238237
@raises(ValueError)
239238
def test_label_error(self):

0 commit comments

Comments
 (0)
0