-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
TST: fix a set of test errors in master. #7639
Conversation
Pathlib was only added to the stdlib in Python 3.4, and there it can handle string type input for a file with UTF8 encoding. But the Patlib version on PyPi that can be installed for Python 2.7 doesn't accept strings, gives errors like: ====================================================================== ERROR: test_ndfromtxt (test_io.TestPathUsage) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/rgommers/Code/numpy/numpy/testing/decorators.py", line 147, in skipper_func return f(*args, **kwargs) File "/home/rgommers/Code/numpy/numpy/lib/tests/test_io.py", line 1888, in test_ndfromtxt f.write('1 2\n3 4') TypeError: must be unicode, not str
@@ -838,7 +838,11 @@ def test_large_file_support(): | |||
|
|||
@dec.slow | |||
def test_large_archive(): | |||
a = np.empty((2 ** 30, 2), dtype=np.uint8) | |||
try: | |||
a = np.empty((2**26, 2), dtype=np.uint8) |
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.
Hmm, is this big enough? The test is for
BUG: Cast size to int64 when loading from archive
Prevents overflow errors for large arrays on systems
where the default int type is int32.
IIRC, the fix was for the product of dimensions that overflowed, so the tested array should probably be multidimensional with total size >= 2**31
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.
Thinking a bit more, this really only needs to be run on 64 bit windows systems.
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.
Ah, a comment on the test intent would have been helpful.....
Indeed, needs to be skipped on 32-bit systems then. For the original size I get:
In [1]: a = np.empty((2**30, 2), dtype=np.uint8)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-1-d8d46384be90> in <module>()
----> 1 a = np.empty((2**30, 2), dtype=np.uint8)
ValueError: array is too big.
Will add the skip, but keep the except MemoryError
- that's always good when trying to allocate such large arrays.
Updated. Also marked two tests as slow, for me |
Thanks Ralf. |
These are the ones I ran into on 32-bit Linux with current master and
Pathlib
installed on Python 2.7: