TST Replaces pytest.warns(None) in test_feature_agglomeration
@@ -3,7 +3,6 @@ Tests for sklearn.cluster._feature_agglomeration
"""
# Authors: Sergul Aydore 2017
import numpy as np
-import pytest
from numpy.testing import assert_array_equal
from sklearn.cluster import FeatureAgglomeration
@@ -17,12 +16,8 @@ def test_feature_agglomeration():
agglo_mean = FeatureAgglomeration(n_clusters=n_clusters, pooling_func=np.mean)
agglo_median = FeatureAgglomeration(n_clusters=n_clusters, pooling_func=np.median)
- with pytest.warns(None) as record:
agglo_mean.fit(X)
- assert not [w.message for w in record]
- with pytest.warns(None) as record:
agglo_median.fit(X)
- assert not [w.message for w in record]
assert np.size(np.unique(agglo_mean.labels_)) == n_clusters
assert np.size(np.unique(agglo_median.labels_)) == n_clusters
