File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1275,6 +1275,11 @@ def load_sample_images():
1275
1275
return Bunch (images = images , filenames = filenames , DESCR = descr )
1276
1276
1277
1277
1278
+ @validate_params (
1279
+ {
1280
+ "image_name" : [StrOptions ({"china.jpg" , "flower.jpg" })],
1281
+ }
1282
+ )
1278
1283
def load_sample_image (image_name ):
1279
1284
"""Load the numpy array of a single sample image.
1280
1285
Original file line number Diff line number Diff line change @@ -222,12 +222,6 @@ def test_load_sample_image():
222
222
warnings .warn ("Could not load sample images, PIL is not available." )
223
223
224
224
225
- def test_load_missing_sample_image_error ():
226
- pytest .importorskip ("PIL" )
227
- with pytest .raises (AttributeError ):
228
- load_sample_image ("blop.jpg" )
229
-
230
-
231
225
def test_load_diabetes_raw ():
232
226
"""Test to check that we load a scaled version by default but that we can
233
227
get an unscaled version when setting `scaled=False`."""
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ def _check_function_param_validation(
138
138
"sklearn.datasets.load_files" ,
139
139
"sklearn.datasets.load_iris" ,
140
140
"sklearn.datasets.load_linnerud" ,
141
+ "sklearn.datasets.load_sample_image" ,
141
142
"sklearn.datasets.load_svmlight_file" ,
142
143
"sklearn.datasets.load_svmlight_files" ,
143
144
"sklearn.datasets.load_wine" ,
You can’t perform that action at this time.
0 commit comments