28
28
from sklearn .datasets .tests .test_common import check_return_X_y
29
29
from sklearn .externals ._arff import ArffContainerType
30
30
from functools import partial
31
+ from sklearn .utils ._testing import fails_if_pypy
31
32
32
33
33
34
currdir = os .path .dirname (os .path .abspath (__file__ ))
@@ -296,6 +297,9 @@ def test_feature_to_dtype_error(feature):
296
297
_feature_to_dtype (feature )
297
298
298
299
300
+ # Known failure of PyPy for OpenML. See the following issue:
301
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
302
+ @fails_if_pypy
299
303
def test_fetch_openml_iris_pandas (monkeypatch ):
300
304
# classification dataset with numeric only columns
301
305
pd = pytest .importorskip ('pandas' )
@@ -337,6 +341,9 @@ def test_fetch_openml_iris_pandas(monkeypatch):
337
341
assert frame .index .is_unique
338
342
339
343
344
+ # Known failure of PyPy for OpenML. See the following issue:
345
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
346
+ @fails_if_pypy
340
347
def test_fetch_openml_iris_pandas_equal_to_no_frame (monkeypatch ):
341
348
# as_frame = True returns the same underlying data as as_frame = False
342
349
pytest .importorskip ('pandas' )
@@ -356,6 +363,9 @@ def test_fetch_openml_iris_pandas_equal_to_no_frame(monkeypatch):
356
363
assert_array_equal (norm_target , frame_target )
357
364
358
365
366
+ # Known failure of PyPy for OpenML. See the following issue:
367
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
368
+ @fails_if_pypy
359
369
def test_fetch_openml_iris_multitarget_pandas (monkeypatch ):
360
370
# classification dataset with numeric only columns
361
371
pd = pytest .importorskip ('pandas' )
@@ -398,6 +408,9 @@ def test_fetch_openml_iris_multitarget_pandas(monkeypatch):
398
408
assert np .all (frame .dtypes == [np .float64 ] * 4 + [cat_dtype ])
399
409
400
410
411
+ # Known failure of PyPy for OpenML. See the following issue:
412
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
413
+ @fails_if_pypy
401
414
def test_fetch_openml_anneal_pandas (monkeypatch ):
402
415
# classification dataset with numeric and categorical columns
403
416
pd = pytest .importorskip ('pandas' )
@@ -435,6 +448,9 @@ def test_fetch_openml_anneal_pandas(monkeypatch):
435
448
assert frame .shape == frame_shape
436
449
437
450
451
+ # Known failure of PyPy for OpenML. See the following issue:
452
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
453
+ @fails_if_pypy
438
454
def test_fetch_openml_cpu_pandas (monkeypatch ):
439
455
# regression dataset with numeric and categorical columns
440
456
pd = pytest .importorskip ('pandas' )
@@ -489,6 +505,9 @@ def test_fetch_openml_australian_pandas_error_sparse(monkeypatch):
489
505
fetch_openml (data_id = data_id , as_frame = True , cache = False )
490
506
491
507
508
+ # Known failure of PyPy for OpenML. See the following issue:
509
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
510
+ @fails_if_pypy
492
511
def test_fetch_openml_as_frame_auto (monkeypatch ):
493
512
pd = pytest .importorskip ('pandas' )
494
513
@@ -503,6 +522,9 @@ def test_fetch_openml_as_frame_auto(monkeypatch):
503
522
assert isinstance (data .data , scipy .sparse .csr_matrix )
504
523
505
524
525
+ # Known failure of PyPy for OpenML. See the following issue:
526
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
527
+ @fails_if_pypy
506
528
def test_convert_arff_data_dataframe_warning_low_memory_pandas (monkeypatch ):
507
529
pytest .importorskip ('pandas' )
508
530
@@ -515,6 +537,9 @@ def test_convert_arff_data_dataframe_warning_low_memory_pandas(monkeypatch):
515
537
fetch_openml (data_id = data_id , as_frame = True , cache = False )
516
538
517
539
540
+ # Known failure of PyPy for OpenML. See the following issue:
541
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
542
+ @fails_if_pypy
518
543
def test_fetch_openml_adultcensus_pandas_return_X_y (monkeypatch ):
519
544
pd = pytest .importorskip ('pandas' )
520
545
CategoricalDtype = pd .api .types .CategoricalDtype
@@ -543,6 +568,9 @@ def test_fetch_openml_adultcensus_pandas_return_X_y(monkeypatch):
543
568
assert y .name == target_column
544
569
545
570
571
+ # Known failure of PyPy for OpenML. See the following issue:
572
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
573
+ @fails_if_pypy
546
574
def test_fetch_openml_adultcensus_pandas (monkeypatch ):
547
575
pd = pytest .importorskip ('pandas' )
548
576
CategoricalDtype = pd .api .types .CategoricalDtype
@@ -579,6 +607,9 @@ def test_fetch_openml_adultcensus_pandas(monkeypatch):
579
607
assert frame .shape == frame_shape
580
608
581
609
610
+ # Known failure of PyPy for OpenML. See the following issue:
611
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
612
+ @fails_if_pypy
582
613
def test_fetch_openml_miceprotein_pandas (monkeypatch ):
583
614
# JvR: very important check, as this dataset defined several row ids
584
615
# and ignore attributes. Note that data_features json has 82 attributes,
@@ -619,6 +650,9 @@ def test_fetch_openml_miceprotein_pandas(monkeypatch):
619
650
assert frame_n_floats == n_floats
620
651
621
652
653
+ # Known failure of PyPy for OpenML. See the following issue:
654
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
655
+ @fails_if_pypy
622
656
def test_fetch_openml_emotions_pandas (monkeypatch ):
623
657
# classification dataset with multiple targets (natively)
624
658
pd = pytest .importorskip ('pandas' )
@@ -657,6 +691,9 @@ def test_fetch_openml_emotions_pandas(monkeypatch):
657
691
assert expected_frame_floats == n_floats
658
692
659
693
694
+ # Known failure of PyPy for OpenML. See the following issue:
695
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
696
+ @fails_if_pypy
660
697
def test_fetch_openml_titanic_pandas (monkeypatch ):
661
698
# dataset with strings
662
699
pd = pytest .importorskip ('pandas' )
@@ -1208,6 +1245,9 @@ def test_fetch_openml_with_ignored_feature(monkeypatch, gzip_response):
1208
1245
assert 'animal' not in dataset ['feature_names' ]
1209
1246
1210
1247
1248
+ # Known failure of PyPy for OpenML. See the following issue:
1249
+ # https://github.com/scikit-learn/scikit-learn/issues/18906
1250
+ @fails_if_pypy
1211
1251
@pytest .mark .parametrize ('as_frame' , [True , False ])
1212
1252
def test_fetch_openml_verify_checksum (monkeypatch , as_frame , cache , tmpdir ):
1213
1253
if as_frame :
0 commit comments