1
+ import warnings
1
2
import numpy as np
2
3
import pickle
3
4
@@ -166,7 +167,12 @@ def test_isotonic_regression_auto_decreasing():
166
167
167
168
# Create model and fit_transform
168
169
ir = IsotonicRegression (increasing = 'auto' )
169
- y_ = assert_no_warnings (ir .fit_transform , x , y )
170
+ with warnings .catch_warnings (record = True ) as w :
171
+ warnings .simplefilter ("always" )
172
+ y_ = ir .fit_transform (x , y )
173
+ # work-around for pearson divide warnings in scipy <= 0.17.0
174
+ assert_true (all (["invalid value encountered in "
175
+ in str (warn .message ) for warn in w ]))
170
176
171
177
# Check that relationship decreases
172
178
is_increasing = y_ [0 ] < y_ [- 1 ]
@@ -180,7 +186,12 @@ def test_isotonic_regression_auto_increasing():
180
186
181
187
# Create model and fit_transform
182
188
ir = IsotonicRegression (increasing = 'auto' )
183
- y_ = assert_no_warnings (ir .fit_transform , x , y )
189
+ with warnings .catch_warnings (record = True ) as w :
190
+ warnings .simplefilter ("always" )
191
+ y_ = ir .fit_transform (x , y )
192
+ # work-around for pearson divide warnings in scipy <= 0.17.0
193
+ assert_true (all (["invalid value encountered in "
194
+ in str (warn .message ) for warn in w ]))
184
195
185
196
# Check that relationship increases
186
197
is_increasing = y_ [0 ] < y_ [- 1 ]
0 commit comments