summaryrefslogtreecommitdiff
path: root/numpy/ma/testutils.py
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2008-07-17 04:20:42 +0000
committerpierregm <pierregm@localhost>2008-07-17 04:20:42 +0000
commite2df0c7f93eab474669d8f690f9de7abecb6fa0e (patch)
tree704d5a884f8c79b87a958a01d102dc9f8e2dc820 /numpy/ma/testutils.py
parent0a9ae133c4b626d3606309a4e3f7c1552bfcf707 (diff)
downloadnumpy-e2df0c7f93eab474669d8f690f9de7abecb6fa0e.tar.gz
testutils
* improved check on object/record arrays core * fixed filled for flexible types * fixed the definition of the mask for flexible types mrecords: * fixed a bug w/ titles/formats in __new__ and __array_finalize__
Diffstat (limited to 'numpy/ma/testutils.py')
-rw-r--r--numpy/ma/testutils.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py
index a2fde4405..33030489c 100644
--- a/numpy/ma/testutils.py
+++ b/numpy/ma/testutils.py
@@ -104,7 +104,16 @@ def assert_equal(actual,desired,err_msg=''):
raise ValueError(msg)
actual = np.array(actual, copy=False, subok=True)
desired = np.array(desired, copy=False, subok=True)
- if actual.dtype.char in "OSV" and desired.dtype.char in "OSV":
+ (actual_dtype, desired_dtype) = (actual.dtype, desired.dtype)
+ if actual_dtype.char == "S" and desired_dtype.char == "S":
+ return _assert_equal_on_sequences(actual.tolist(),
+ desired.tolist(),
+ err_msg='')
+ elif actual_dtype.char in "OV" and desired_dtype.char in "OV":
+ if (actual_dtype != desired_dtype) and actual_dtype:
+ msg = build_err_msg([actual_dtype, desired_dtype],
+ err_msg, header='', names=('actual', 'desired'))
+ raise ValueError(msg)
return _assert_equal_on_sequences(actual.tolist(),
desired.tolist(),
err_msg='')