summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/tests/test_multiarray.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index edb64cd61..0c2d55ae6 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -303,15 +303,21 @@ class TestCreation(TestCase):
assert_equal(array(nstr, dtype=type), result, err_msg=msg)
def test_non_sequence_sequence(self):
- """Should not segfault."""
- class x(object):
+ """Should not segfault.
+
+ Class Foo breaks the sequence protocol for new style classes, i.e.,
+ those derived from object. At some point we may raise a warning in
+ this case.
+
+ """
+ class Foo(object):
def __len__(self):
return 1
def __getitem__(self):
raise ValueError('hi there')
- a = np.array([x()])
+ a = np.array([Foo()])
assert_(a.shape == (1,))
assert_(a.dtype == np.dtype(object))