8000 Fix CI · scikit-learn/scikit-learn@f96210a · GitHub
[go: up one dir, main page]

Skip to content

Commit f96210a

Browse files
committed
Fix CI
1 parent 639488c commit f96210a

File tree

4 files changed

+30
-33
lines changed

4 files changed

+30
-33
lines changed

sklearn/ensemble/tests/test_forest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -918,13 +918,13 @@ def check_1d_input(name, X, X_2d, y):
918918

919919

920920
@pytest.mark.parametrize('name', FOREST_ESTIMATORS)
921-
@ignore_warnings
922921
def test_1d_input(name):
923922
X = iris.data[:, 0]
924923
X_2d = iris.data[:, 0].reshape((-1, 1))
925924
y = iris.target
926925

927-
check_1d_input(name, X, X_2d, y)
926+
with ignore_warnings():
927+
check_1d_input(name, X, X_2d, y)
928928

929929

930930
def check_class_weights(name):

sklearn/mixture/tests/test_gmm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ def test_GMM_attributes():
162162
with pytest.raises(ValueError):
163163
g._set_covars([])
164164
with pytest.raises(ValueError):
165-
g._set_covars( np.zeros((n_components - 2, n_features)))
165+
g._set_covars(np.zeros((n_components - 2, n_features)))
166166
with pytest.raises(ValueError):
167-
mixture.GMM( n_components=20, covariance_type='badcovariance_type')
167+
mixture.GMM(n_components=20, covariance_type='badcovariance_type')
168168

169169

170170
class GMMTester():

sklearn/utils/testing.py

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -697,32 +697,27 @@ def run_test(*args, **kwargs):
697697
reason='skip on travis')
698698

699699

700-
def if_safe_multiprocessing_with_blas(func):
701-
"""Decorator for tests involving both BLAS calls and multiprocessing.
702-
703-
Under POSIX (e.g. Linux or OSX), using multiprocessing in conjunction with
704-
some implementation of BLAS (or other libraries that manage an internal
705-
posix thread pool) can cause a crash or a freeze of the Python process.
706-
707-
In practice all known packaged distributions (from Linux distros or
708-
Anaconda) of BLAS under Linux seems to be safe. So we this problem seems to
709-
only impact OSX users.
710-
711-
This wrapper makes it possible to skip tests that can possibly cause
712-
this crash under OS X with.
713-
714-
Under Python 3.4+ it is possible to use the `forkserver` start method
715-
for multiprocessing to avoid this issue. However it can cause pickling
716-
errors on interactively defined functions. It therefore not enabled by
717-
default.
718-
"""
719-
@wraps(func)
720-
def run_test(*args, **kwargs):
721-
if sys.platform == 'darwin':
722-
raise SkipTest(
723-
"Possible multi-process bug with some BLAS")
724-
return func(*args, **kwargs)
725-
return run_test
700+
# Decorator for tests involving both BLAS calls and multiprocessing.
701+
#
702+
# Under POSIX (e.g. Linux or OSX), using multiprocessing in conjunction with
703+
# some implementation of BLAS (or other libraries that manage an internal
704+
# posix thread pool) can cause a crash or a freeze of the Python process.
705+
#
706+
# In practice all known packaged distributions (from Linux distros or
707+
# Anaconda) of BLAS under Linux seems to be safe. So we this problem seems to
708+
# only impact OSX users.
709+
#
710+
# This wrapper makes it possible to skip tests that can possibly cause
711+
# this crash under OS X with.
712+
#
713+
# Under Python 3.4+ it is possible to use the `forkserver` start method
714+
# for multiprocessing to avoid this issue. However it can cause pickling
715+
# errors on interactively defined functions. It therefore not enabled by
716+
# default.
717+
718+
if_safe_multiprocessing_with_blas = pytest.mark.skipif(
719+
sys.platform == 'darwin',
720+
reason="Possible multi-process bug with some BLAS")
726721

727722

728723
def clean_warning_registry():

sklearn/utils/tests/test_stats.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
)
1515

1616

17-
@ignore_warnings # Test deprecated backport to be removed in 0.21
1817
@pytest.mark.parametrize("values, method, expected", _cases)
1918
def test_cases_rankdata(values, method, expected):
20-
r = rankdata(values, method=method)
21-
assert_array_equal(r, expected)
19+
20+
# Test deprecated backport to be removed in 0.21
21+
with ignore_warnings():
22+
r = rankdata(values, method=method)
23+
assert_array_equal(r, expected)

0 commit comments

Comments
 (0)
0