Test failures TestNewBufferProtocol.test_error_too_many_dims
See original GitHub issueSee: https://travis-ci.org/MacPython/numpy-wheels/jobs/380655687
________________ TestNewBufferProtocol.test_error_too_many_dims ________________
self = <numpy.core.tests.test_multiarray.TestNewBufferProtocol object at 0xf041f20c>
def test_error_too_many_dims(self):
def make_ctype(shape, scalar_type):
t = scalar_type
for dim in shape[::-1]:
t = dim * t
return t
# construct a memoryview with 33 dimensions
c_u8_33d = make_ctype((1,)*33, ctypes.c_uint8)
m = memoryview(c_u8_33d())
assert_equal(m.ndim, 33)
assert_raises_regex(
RuntimeError, "ndim",
> np.array, m)
c_u8_33d = <class 'numpy.core.tests.test_multiarray.c_ubyte_Array_1_Array_1_Array_1_Array...ay_1_Array_1_Array_1_Array_1_Array_1_Array_1_Array_1_Array_1_Array_1__Array_1'>
m = <memory at 0xf2da0e3c>
make_ctype = <function make_ctype at 0xf041cb1c>
self = <numpy.core.tests.test_multiarray.TestNewBufferProtocol object at 0xf041f20c>
/venv/local/lib/python2.7/site-packages/numpy/core/tests/test_multiarray.py:6534:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <numpy.testing._private.utils._Dummy testMethod=nop>
expected_exception = <type 'exceptions.RuntimeError'>, expected_regexp = 'ndim'
callable_obj = <built-in function array>, args = (<memory at 0xf2da0e3c>,)
kwargs = {}, context = <unittest.case._AssertRaisesContext object at 0xf041ff2c>
def assertRaisesRegexp(self, expected_exception, expected_regexp,
callable_obj=None, *args, **kwargs):
"""Asserts that the message in a raised exception matches a regexp.
Args:
expected_exception: Exception class expected to be raised.
expected_regexp: Regexp (re pattern object or string) expected
to be found in error message.
callable_obj: Function to be called.
args: Extra args.
kwargs: Extra kwargs.
"""
context = _AssertRaisesContext(expected_exception, self, expected_regexp)
if callable_obj is None:
return context
with context:
> callable_obj(*args, **kwargs)
E ValueError: '(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1)<B' is not a valid PEP 3118 buffer format string
args = (<memory at 0xf2da0e3c>,)
callable_obj = <built-in function array>
context = <unittest.case._AssertRaisesContext object at 0xf041ff2c>
expected_exception = <type 'exceptions.RuntimeError'>
expected_regexp = 'ndim'
kwargs = {}
self = <numpy.testing._private.utils._Dummy testMethod=nop>
Only for 32-bit Unicode Python 2.7: https://travis-ci.org/MacPython/numpy-wheels/builds/380655679
Error present at commit db552b5b6 “Merge pull request #10996 from adeak/docfix-stringio-unicode” (23 days ago).
Not present at commit b5c1bcf1e “Merge pull request #10891 from eric-wieser/assert-no-cycles” (25 days ago): https://travis-ci.org/MacPython/numpy-wheels/builds/370054701
In git log b5c1bcf1e..db552b5b6
I noticed references to #10971 and #10882 which both mention buffers - are they relevant?
Issue Analytics
- State:
- Created 5 years ago
- Comments:25 (25 by maintainers)
Top Results From Across the Web
unittest — Unit testing framework — Python 3.11.1 ...
A test fixture represents the preparation needed to perform one or more ... The standard output and standard error streams are buffered during...
Read more >make check unit test failures and segmentation fault
I am compiling on board rather than cross compiling, and am failing some unit tests when I run "make check". Most of the...
Read more >Pilot COVID-19 At-Home Test - FDA
Failure to squeeze the tube can lead to incorrect results due to excess buffer in the swab. Positive result. If the Control line...
Read more >A 0.85% saline as alternative detection buffer for SD-Bioline ...
SD-Bioline® HIV diagnostic test kits are usually packed with a single diluent buffer whereby in some occasions the buffer supplied tends to be...
Read more >1910.134 App A - Fit Testing Procedures (Mandatory).
For the modified ambient aerosol CNC quantitative fit testing protocols, ... (8) If the test is failed, the subject shall return to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Let’s just add a
skipif
decorator to the test and move on. Don’t see the use ofxfail
here, as the test will xpass for later versions of Python 2.7 and the test is just there to check the new error message.Why not use the ctypes result to decide whether to run the test?
On Sun, 20 May 2018 2:48 AM Eric Wieser, notifications@github.com wrote: