TST Replaces pytest.warns(None) in test_dict_learning
import pytest
+import warnings
import numpy as np
from functools import partial
@@ -111,12 +112,12 @@ def test_max_iter():
model.fit_transform(X)
# check that the underlying model converges w/o warnings
- with pytest.warns(None) as record:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error", ConvergenceWarning)
model = SparseCoder(
D_multi, transform_algorithm=transform_algorithm, transform_max_iter=2000
)
model.fit_transform(X)
- assert not [w.message for w in record]
def test_dict_learning_lars_positive_parameter():
