8000 MNT skip preprocessing.rst when pandas is not installed (#19016) · thomasjpfan/scikit-learn@51bd343 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51bd343

Browse files
authored
MNT skip preprocessing.rst when pandas is not installed (scikit-learn#19016)
1 parent 105d37a commit 51bd343

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

doc/conftest.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
from os.path import join
44
import warnings
55

6-
import numpy as np
7-
86
from sklearn.utils import IS_PYPY
97
from sklearn.utils._testing import SkipTest
108
from sklearn.utils._testing import check_skip_network
@@ -72,6 +70,13 @@ def setup_grid_search():
7270
raise SkipTest("Skipping grid_search.rst, pandas not installed")
7371

7472

73+
def setup_preprocessing():
74+
try:
75+
import pandas # noqa
76+
except ImportError:
77+
raise SkipTest("Skipping preprocessing.rst, pandas not installed")
78+
79+
7580
def setup_unsupervised_learning():
7681
try:
7782
import skimage # noqa
@@ -105,5 +110,7 @@ def pytest_runtest_setup(item):
105110
setup_impute()
106111
elif fname.endswith('modules/grid_search.rst'):
107112
setup_grid_search()
113+
elif fname.endswith('modules/preprocessing.rst'):
114+
setup_preprocessing()
108115
elif fname.endswith('statistical_inference/unsupervised_learning.rst'):
109116
setup_unsupervised_learning()

0 commit comments

Comments
 (0)
0