8000 Pandas fix by charris · Pull Request #50 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Pandas fix #50

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

Merged
9 commits merged into from
Mar 10, 2011
Prev Previous commit
Next Next commit
TST: Add test for robustness with non-sequence detected as sequence.
  • Loading branch information
charris committed Mar 8, 2011
commit 90e4cf055c8b469634cdb6c84e0a8843c2212e78
14 changes: 14 additions & 0 deletions numpy/core/tests/test_multiarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,20 @@ def test_from_string(self) :
msg = 'String conversion for %s' % type
assert_equal(array(nstr, dtype=type), result, err_msg=msg)

def test_non_sequence_sequence(self):
"""Should not segfault."""
class x(object):
def __len__(self):
return 1

def __getitem__(self):
raise ValueError('hi there')

a = np.array([x()])
assert_(a.shape == (1,))
assert_(a.dtype == np.dtype(object))


class TestStructured(TestCase):
def test_subarray_field_access(self):
a = np.zeros((3, 5), dtype=[('a', ('i4', (2, 2)))])
Expand Down
0