8000 Ignore deprecation warnings and skip new tests that use hashing · scikit-learn/scikit-learn@16b9f76 · GitHub
[go: up one dir, main page]

Skip to content

Commit 16b9f76

Browse files
committed
Ignore deprecation warnings and skip new tests that use hashing
1 parent 6d14857 commit 16b9f76

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

build_tools/circle/build_test_pypy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ccache -M 512M
2525
export CCACHE_COMPRESS=1
2626
export PATH=/usr/lib/ccache:$PATH
2727

28-
pip install -e .
28+
pip install -vv -e .
2929

30-
pytest -n 1 sklearn/
30+
pytest -n 1 -Wignore::DeprecationWarning -Wignore::FutureWarning sklearn/
3131
make test-sphinxext test-doc

conftest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717
raise('Your version of pytest is too old, you should have at least '
1818
'pytest >= {} installed.'.format(PYTEST_MIN_VERSION))
1919

20+
2021
def pytest_collection_modifyitems(config, items):
2122

2223
# FeatureHasher is not compatible with PyPy
2324
if platform.python_implementation() == 'PyPy':
2425
skip_marker = pytest.mark.skip(
2526
reason='FeatureHasher is not compatible with PyPy')
2627
for item in items:
27-
if item.name == 'sklearn.feature_extraction.hashing.FeatureHasher':
28+
if item.name in (
29+
'sklearn.feature_extraction.hashing.FeatureHasher',
30+
'sklearn.feature_extraction.text.HashingVectorizer'):
2831
item.add_marker(skip_marker)
2932

3033
# numpy changed the str/repr formatting of numpy arrays in 1.14. We want to

sklearn/feature_extraction/tests/test_text.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,8 @@ def test_vectorizers_invalid_ngram_range(vec):
11081108
message = ("Invalid value for ngram_range=%s "
11091109
"lower boundary larger than the upper boundary."
11101110
% str(invalid_range))
1111+
if isinstance(vec, HashingVectorizer):
1112+
pytest.xfail(reason='HashingVectorizer not supported on PyPy')
11111113

11121114
assert_raise_message(
11131115
ValueError, message, vec.fit, ["good news everyone"])
@@ -1119,6 +1121,7 @@ def test_vectorizers_invalid_ngram_range(vec):
11191121
ValueError, message, vec.transform, ["good news everyone"])
11201122

11211123

1124+
@fails_if_pypy
11221125
def test_vectorizer_stop_words_inconsistent():
11231126
if PY2:
11241127
lstr = "[u'and', u'll', u've']"

0 commit comments

Comments
 (0)
0