10000 Fix invalid typestring size by jayvius · Pull Request #2797 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Fix invalid typestring size #2797

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
merged 6 commits into from
Dec 21, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Modify unit tests for 32 bit support
  • Loading branch information
jayvius committed Dec 21, 2012
commit ab2d5d25d94fc463f5613c1750e8b1fb3f810e1d
19 changes: 17 additions & 2 deletions numpy/core/tests/test_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,26 @@ def test_invalid_types(self):
# For now, display a deprecation warning for invalid
# type sizes. In the future this should be changed
# to an exception.
for typestr in ['O3', 'O5', 'O7', 'b3', 'h4', 'I5', 'l4',
'L4', 'q16', 'Q16', 'e3', 'f5', 'g12']:

for typestr in ['O3', 'O5', 'O7', 'b3', 'h4', 'I5',
'e3', 'f5', 'g12']:
#print typestr
assert_warns(DeprecationWarning, np.dtype, typestr)

if np.dtype('l').itemsize == 8:
assert_warns(DeprecationWarning, np.dtype, 'l4')
assert_warns(DeprecationWarning, np.dtype, 'L4')
else:
assert_warns(DeprecationWarning, np.dtype, 'l8')
assert_warns(DeprecationWarning, np.dtype, 'L8')

if np.dtype('q').itemsize == 8:
assert_warns(DeprecationWarning, np.dtype, 'q4')
assert_warns(DeprecationWarning, np.dtype, 'Q4')
else:
assert_warns(DeprecationWarning, np.dtype, 'q8')
assert_warns(DeprecationWarning, np.dtype, 'Q8')

assert_raises(TypeError, np.dtype, 't8', 'NA[u4,0xffffffff]')

def test_bad_param(self):
Expand Down
0