Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9450c33

Browse files
committed
Replace use or assert_no_warnings
1 parent b92a395 commit 9450c33

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sklearn/feature_extraction/tests/test_text.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
from sklearn.utils import IS_PYPY
3131
from sklearn.utils._testing import (assert_almost_equal,
3232
assert_raise_message,
33-
assert_no_warnings,
3433
fails_if_pypy,
3534
assert_allclose_dense_sparse,
3635
skip_if_32bit)
@@ -1215,7 +1214,9 @@ def test_vectorizer_stop_words_inconsistent():
12151214
assert _check_stop_words_consistency(vec) is False
12161215

12171216
# Only one warning per stop list
1218-
assert_no_warnings(vec.fit_transform, ['hello world'])
1217+
with pytest.warns(None) as record:
1218+
vec.fit_transform(['hello world'])
1219+
assert not len(record)
12191220
assert _check_stop_words_consistency(vec) is None
12201221

12211222
# Test caching of inconsistency assessment

0 commit comments

Comments
 (0)