10000 Test failures TestNewBufferProtocol.test_error_too_many_dims · Issue #11115 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
Test failures TestNewBufferProtocol.test_error_too_many_dims #11115
Closed
@matthew-brett

Description

@matthew-brett

See: 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&g
6487
t;
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 db552b5 "Merge pull request #10996 from adeak/docfix-stringio-unicode" (23 days ago).

Not present at commit b5c1bcf "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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0