Closed
Conversation
rth
reviewed
Jun 22, 2019
Member
There was a problem hiding this comment.
Thanks for your PR!
I don't think that a warning is a right solution here (cf #14029 (comment)). Let's wait for some feedback by other contributors in that issue.
Also this includes a test.py which shouldn't be part of this PR.
Member
|
I think that @rth as more this in head: diff --git a/conftest.py b/conftest.py
index f8ced99fc..73326d6d2 100644
--- a/conftest.py
+++ b/conftest.py
@@ -8,10 +8,12 @@
import platform
from distutils.version import LooseVersion
-from sklearn import set_config
import pytest
from _pytest.doctest import DoctestItem
+from sklearn import set_config
+from sklearn.utils import _IS_32BIT
+
PYTEST_MIN_VERSION = '3.3.0'
if LooseVersion(pytest.__version__) < PYTEST_MIN_VERSION:
@@ -51,13 +53,17 @@ def pytest_collection_modifyitems(config, items):
try:
import numpy as np
if LooseVersion(np.__version__) < LooseVersion('1.14'):
+ reason = 'doctests are only run for numpy >= 1.14'
+ skip_doctests = True
+ elif _IS_32BIT:
+ reason = ('doctest are only run when the default numpy int is '
+ '64 bits.')
skip_doctests = True
except ImportError:
pass
if skip_doctests:
- skip_marker = pytest.mark.skip(
- reason='doctests are only run for numpy >= 1.14 and python >= 3')
+ skip_marker = pytest.mark.skip(reason=reason)
for item in items:
if isinstance(item, DoctestItem):
|
Member
|
Closing as this was resolved in #14167. Thanks for contributing! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for: #14029.
The doctests would fail if the default numpy.int is 32 bits long.I have a step somewhere for pytest to warn