Skip to content

Commit 645cb56

Browse files
committed
ignore DeprecationWarning in tests
1 parent a7af1fd commit 645cb56

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sklearn/neighbors/tests/test_lof.py

+8
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ def test_contamination():
163163
assert_raises(ValueError, clf.fit, X)
164164

165165

166+
@ignore_warnings(category=DeprecationWarning)
167+
# contamination changed to 'auto' 0.22
166168
def test_novelty_errors():
167169
X = iris.data
168170

@@ -180,6 +182,8 @@ def test_novelty_errors():
180182
assert_raises_regex(AttributeError, msg, getattr, clf, 'fit_predict')
181183

182184

185+
@ignore_warnings(category=DeprecationWarning)
186+
# contamination changed to 'auto' 0.22
183187
def test_novelty_training_scores():
184188
# check that the scores of the training samples are still accessible
185189
# when novelty=True through the negative_outlier_factor_ attribute
@@ -198,6 +202,8 @@ def test_novelty_training_scores():
198202
assert_array_almost_equal(scores_1, scores_2)
199203

200204

205+
@ignore_warnings(category=DeprecationWarning)
206+
# contamination changed to 'auto' 0.22
201207
def test_hasattr_prediction():
202208
# check availability of prediction methods depending on novelty value.
203209
X = [[1, 1], [1, 2], [2, 1]]
@@ -219,6 +225,8 @@ def test_hasattr_prediction():
219225
assert not hasattr(clf, 'score_samples')
220226

221227

228+
@ignore_warnings(category=DeprecationWarning)
229+
# contamination changed to 'auto' 0.22
222230
def test_novelty_true_common_tests():
223231
# the common tests are run for the default LOF (novelty=False).
224232
# here we run these common tests for LOF when novelty=True

0 commit comments

Comments
 (0)