8000 TST remove pytest.warns(None) in test_svm.py (#23030) · glemaitre/scikit-learn@285db1b · GitHub
[go: up one dir, main page]

Skip to content

Commit 285db1b

Browse files
iasoonglemaitre
authored andcommitted
TST remove pytest.warns(None) in test_svm.py (scikit-learn#23030)
1 parent 95a1808 commit 285db1b

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

sklearn/svm/tests/test_svm.py

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,34 +1331,13 @@ def test_svc_ovr_tie_breaking(SVCClass):
13311331
assert np.all(pred == np.argmax(dv, axis=1))
13321332

13331333

1334-
def test_gamma_auto():
1335-
X, y = [[0.0, 1.2], [1.0, 1.3]], [0, 1]
1336-
1337-
with pytest.warns(None) as record:
1338-
svm.SVC(kernel="linear").fit(X, y)
1339-
assert not [w.message for w in record]
1340-
1341-
with pytest.warns(None) as record:
1342-
svm.SVC(kernel="precomputed").fit(X, y)
1343-
assert not [w.message for w in record]
1344-
1345-
13461334
def test_gamma_scale():
13471335
X, y = [[0.0], [1.0]], [0, 1]
13481336

13491337
clf = svm.SVC()
1350-
with pytest.warns(None) as record:
1351-
clf.fit(X, y)
1352-
assert not [w.message for w in record]
1338+
clf.fit(X, y)
13531339
assert_almost_equal(clf._gamma, 4)
13541340

1355-
# X_var ~= 1 shouldn't raise warning, for when
1356-
# gamma is not explicitly set.
1357-
X, y = [[1, 2], [3, 2 * np.sqrt(6) / 3 + 2]], [0, 1]
1358-
with pytest.warns(None) as record:
1359-
clf.fit(X, y)
1360-
assert not [w.message for w in record]
1361-
13621341

13631342
@pytest.mark.parametrize(
13641343
"SVM, params",

0 commit comments

Comments
 (0)
0