From e9b75b0a221d55bc9668de405d4e9e955363434d Mon Sep 17 00:00:00 2001 From: Hanmin Qin Date: Thu, 22 Nov 2018 16:55:08 +0800 Subject: [PATCH 1/3] TST Ignore Kmeans test failures on MacOS --- sklearn/cluster/tests/test_k_means.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sklearn/cluster/tests/test_k_means.py b/sklearn/cluster/tests/test_k_means.py index cec0fa2897546..a467b80538447 100644 --- a/sklearn/cluster/tests/test_k_means.py +++ b/sklearn/cluster/tests/test_k_means.py @@ -336,6 +336,10 @@ def test_k_means_fit_predict(algo, dtype, constructor, seed, max_iter, tol): # There's a very small chance of failure with elkan on unstructured dataset # because predict method uses fast euclidean distances computation which # may cause small numerical instabilities. + if sys.platform == "darwin": + pytest.xfail( + "Known failures on MacOS, See " + "https://github.com/scikit-learn/scikit-learn/issues/12644") if not (algo == 'elkan' and constructor is sp.csr_matrix): rng = np.random.RandomState(seed) From 9bfbe141d283f89d300e933dffff67a8ad5a034e Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Tue, 30 Apr 2019 23:51:22 +1000 Subject: [PATCH 2/3] Add comment about test redundancy and purpose --- sklearn/cluster/tests/test_k_means.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sklearn/cluster/tests/test_k_means.py b/sklearn/cluster/tests/test_k_means.py index 158c21aadbb87..cfab15e1d379c 100644 --- a/sklearn/cluster/tests/test_k_means.py +++ b/sklearn/cluster/tests/test_k_means.py @@ -332,6 +332,9 @@ def test_k_means_fit_predict(algo, dtype, constructor, seed, max_iter, tol): # There's a very small chance of failure with elkan on unstructured dataset # because predict method uses fast euclidean distances computation which # may cause small numerical instabilities. + # NB: This test is largely redundant wrt test_predict and test_predict_equal_labels + # This has the added effect of testing idempotence of the fittng procesdure + # which appears to be where it fails on some MacOS setups. if sys.platform == "darwin": pytest.xfail( "Known failures on MacOS, See " From 96f75a043ab58e2d5959b5edc515b3feb934cedc Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Wed, 1 May 2019 00:18:59 +1000 Subject: [PATCH 3/3] line length --- sklearn/cluster/tests/test_k_means.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sklearn/cluster/tests/test_k_means.py b/sklearn/cluster/tests/test_k_means.py index cfab15e1d379c..3788039194520 100644 --- a/sklearn/cluster/tests/test_k_means.py +++ b/sklearn/cluster/tests/test_k_means.py @@ -332,9 +332,10 @@ def test_k_means_fit_predict(algo, dtype, constructor, seed, max_iter, tol): # There's a very small chance of failure with elkan on unstructured dataset # because predict method uses fast euclidean distances computation which # may cause small numerical instabilities. - # NB: This test is largely redundant wrt test_predict and test_predict_equal_labels - # This has the added effect of testing idempotence of the fittng procesdure - # which appears to be where it fails on some MacOS setups. + # NB: This test is largely redundant with respect to test_predict and + # test_predict_equal_labels. This test has the added effect of + # testing idempotence of the fittng procesdure which appears to + # be where it fails on some MacOS setups. if sys.platform == "darwin": pytest.xfail( "Known failures on MacOS, See "