Skip to content

Commit 01b230d

Browse files
committed
disable one unstable unittests when scikit-learn<0.24
1 parent 240dfd1 commit 01b230d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

_unittests/ut_mlmodel/test_classification_kmeans.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ def test_classification_kmeans_intercept_weights(self):
3939
iris = datasets.load_iris()
4040
X, y = iris.data, iris.target
4141
clr = ClassifierAfterKMeans()
42-
clr.fit(X, y, sample_weight=numpy.ones((X.shape[0],)))
42+
try:
43+
clr.fit(X, y, sample_weight=numpy.ones((X.shape[0],)))
44+
except AttributeError as e:
45+
if compare_module_version(sklver, "0.24") < 0:
46+
return
47+
raise e
4348
acc = clr.score(X, y)
4449
self.assertGreater(acc, 0)
4550

azure-pipelines.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ jobs:
4444
pip install -r requirements.txt
4545
displayName: 'Install Requirements'
4646
- script: python -u setup.py build_ext --inplace
47-
displayName: 'Runs Unit Tests'
47+
displayName: 'Build package inplace'
4848
- script: python -u setup.py unittests
4949
displayName: 'Runs Unit Tests'
5050
- script: python -u setup.py bdist_wheel
51-
displayName: 'Build Package'
51+
displayName: 'Build wheel'
5252
#- script: python -u setup.py build_sphinx
5353
# displayName: 'Builds Documentation'
5454
- task: PublishPipelineArtifact@0
@@ -62,7 +62,8 @@ jobs:
6262
strategy:
6363
matrix:
6464
Python39-MacOs:
65-
python.version: "3.9"
65+
python.version: '3.9'
66+
maxParallel: 3
6667
steps:
6768
- task: UsePythonVersion@0
6869
inputs:
@@ -107,11 +108,11 @@ jobs:
107108
- script: |
108109
# export MACOSX_DEPLOYMENT_TARGET=10.13
109110
python setup.py build_ext --inplace
110-
displayName: 'Build package'
111+
displayName: 'Build package inplace'
111112
- script: python -u setup.py unittests
112113
displayName: 'Runs Unit Tests'
113114
- script: python -u setup.py bdist_wheel
114-
displayName: 'Build Package'
115+
displayName: 'Build wheel'
115116
- task: PublishPipelineArtifact@0
116117
inputs:
117118
artifactName: 'wheel-mac-$(python.version)'

0 commit comments

Comments
 (0)