-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
MAINT: Remove sys.version checks in tests #15305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if v.shape is None: | ||
return len(v) * v.itemsize | ||
# Python 3.3+ uses a flexible string representation | ||
ucs4 = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a note to simplify this and a couple of other things later
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps worth tagging all of this type of thing with a # TODO[gh-####]
in the source, where gh-####
is some tracking issue that may or may not already exist.
That way, if you forget later, someone else will be able to work it out.
numpy/core/tests/test_multiarray.py
Outdated
pytest.skip('non ascii unicode field indexing skipped; ' | ||
'raises segfault on python 2.x') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scary stuff! A little alarmed there's no issue reference here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it still scary if it's going away?
I traced the origin of the code to ~9 years ago 99fc128 but it doesn't offer any explanation.
Eric's comment about EMPTY = () |
Part of #15306 |
f76ab11
to
2503a3b
Compare
if sys.version_info.major > 2: | ||
# map returns a list on Python 2 | ||
with assert_warns(FutureWarning): | ||
hstack(map(lambda x: x, np.ones((3, 2)))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you removed this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I accidentally reverted it, added back, tested locally and pushed.
encoding='latin1') | ||
assert_raises(ImportError, data.__getitem__, 'x') | ||
data.close() | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too bad np.load
is not a context manager
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just @mattip's pending comment about the accidentally-removed test left to handle
2503a3b
to
ac4d1d2
Compare
ac4d1d2
to
1427484
Compare
@eric-wieser I fixed mattip's comment, I think this can be submitted now |
Thanks @sethtroisi |
Cleanup checks for python2 (via sys.version) in test files.