8000 using pytest.importorskip to handle test environments without pandas … · scikit-learn/scikit-learn@19ed2f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 19ed2f3

Browse files
committed
using pytest.importorskip to handle test environments without pandas installed
1 parent ee19ac7 commit 19ed2f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sklearn/datasets/tests/test_california_housing.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
Skipped if california_housing is not already downloaded to data_home.
44
"""
55

6+
import pytest
7+
68
from sklearn.datasets import fetch_california_housing
7-
from sklearn.utils import check_pandas_support
89
from sklearn.utils._testing import SkipTest
910
from sklearn.datasets.tests.test_common import check_return_X_y
1011
from functools import partial
@@ -28,7 +29,7 @@ def test_fetch():
2829

2930

3031
def test_fetch_asframe():
31-
pd = check_pandas_support('test_fetch_asframe with as_frame=True')
32+
pd = pytest.importorskip('pandas')
3233
bunch = fetch(as_frame=True)
3334
frame = bunch.frame
3435
assert (hasattr(bunch, 'frame') is True)

0 commit comments

Comments
 (0)
0