Skip to content

Commit

Permalink
MNT minor clean-up of sklearn/conftests.py (scikit-learn#25358)
Browse files Browse the repository at this point in the history
  • Loading branch information
lesteve committed Jan 11, 2023
1 parent 5b23a2d commit 26aaa86
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions sklearn/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,27 +132,22 @@ def pytest_collection_modifyitems(config, items):
)
item.add_marker(marker)

# numpy changed the str/repr formatting of numpy arrays in 1.14. We want to
# run doctests only for numpy >= 1.14.
skip_doctests = False
try:
import matplotlib # noqa
except ImportError:
skip_doctests = True
reason = "matplotlib is required to run the doctests"

try:
if _IS_32BIT:
reason = "doctest are only run when the default numpy int is 64 bits."
skip_doctests = True
elif sys.platform.startswith("win32"):
reason = (
"doctests are not run for Windows because numpy arrays "
"repr is inconsistent across platforms."
)
skip_doctests = True
except ImportError:
pass
if _IS_32BIT:
reason = "doctest are only run when the default numpy int is 64 bits."
skip_doctests = True
elif sys.platform.startswith("win32"):
reason = (
"doctests are not run for Windows because numpy arrays "
"repr is inconsistent across platforms."
)
skip_doctests = True

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

0 comments on commit 26aaa86

Please sign in to comment.