8000 MNT minor clean-up of sklearn/conftests.py (#25358) · glemaitre/scikit-learn@c9b5d02 · GitHub
[go: up one dir, main page]

Skip to content

Commit c9b5d02

Browse files
lesteveglemaitre
authored andcommitted
MNT minor clean-up of sklearn/conftests.py (scikit-learn#25358)
1 parent 3ed8832 commit c9b5d02

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

sklearn/conftest.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -132,27 +132,22 @@ def pytest_collection_modifyitems(config, items):
132132
)
133133
item.add_marker(marker)
134134

135-
# numpy changed the str/repr formatting of numpy arrays in 1.14. We want to
136-
# run doctests only for numpy >= 1.14.
137135
skip_doctests = False
138136
try:
139137
import matplotlib # noqa
140138
except ImportError:
141139
skip_doctests = True
142140
reason = "matplotlib is required to run the doctests"
143141

144-
try:
145-
if _IS_32BIT:
146-
reason = "doctest are only run when the default numpy int is 64 bits."
147-
skip_doctests = True
148-
elif sys.platform.startswith("win32"):
149-
reason = (
150-
"doctests are not run for Windows because numpy arrays "
151-
"repr is inconsistent across platforms."
152-
)
153-
skip_doctests = True
154-
except ImportError:
155-
pass
142+
if _IS_32BIT:
143+
reason = "doctest are only run when the default numpy int is 64 bits."
144+
skip_doctests = True
145+
elif sys.platform.startswith("win32"):
146+
reason = (
147+
"doctests are not run for Windows because numpy arrays "
148+
"repr is inconsistent across platforms."
149+
)
150+
skip_doctests = True
156151

157152
# Normally doctest has the entire module's scope. Here we set globs to an empty dict
158153
# to remove the module's scope:

0 commit comments

Comments
 (0)
0