TST remove pytest.warns(None) in test_svm.py
@@ -1331,34 +1331,13 @@ def test_svc_ovr_tie_breaking(SVCClass):
assert np.all(pred == np.argmax(dv, axis=1))
-def test_gamma_auto():
- X, y = [[0.0, 1.2], [1.0, 1.3]], [0, 1]
-
- with pytest.warns(None) as record:
- svm.SVC(kernel="linear").fit(X, y)
- assert not [w.message for w in record]
-
- with pytest.warns(None) as record:
- svm.SVC(kernel="precomputed").fit(X, y)
- assert not [w.message for w in record]
-
-
def test_gamma_scale():
X, y = [[0.0], [1.0]], [0, 1]
clf = svm.SVC()
- with pytest.warns(None) as record:
clf.fit(X, y)
- assert not [w.message for w in record]
assert_almost_equal(clf._gamma, 4)
- # X_var ~= 1 shouldn't raise warning, for when
- # gamma is not explicitly set.
- X, y = [[1, 2], [3, 2 * np.sqrt(6) / 3 + 2]], [0, 1]
- with pytest.warns(None) as record:
- clf.fit(X, y)
- assert not [w.message for w in record]
-
@pytest.mark.parametrize(
"SVM, params",
