Skip to content

Commit 9bff7d6

Browse files
amuellerogrisel
authored andcommitted
add test for auto increasing
1 parent b5286c3 commit 9bff7d6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sklearn/tests/test_isotonic.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,12 @@ def test_isotonic_regression_auto_increasing():
186186

187187
# Create model and fit_transform
188188
ir = IsotonicRegression(increasing='auto')
189-
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]))
190195

191196
# Check that relationship increases
192197
is_increasing = y_[0] < y_[-1]

0 commit comments

Comments
 (0)