Commit 49dce1de authored by Christoph Groth's avatar Christoph Groth
Browse files

improve test

parent 387cdc5d
......@@ -322,17 +322,8 @@ def test_pickle():
import cPickle as pickle
except ImportError:
import pickle
import numpy.random as nr
tests = [ta.array((100 * nr.rand(10)).astype(int)), # 1D
ta.array(nr.rand(10)),
ta.array(nr.rand(10) + 1j * nr.rand(10)),
ta.array((100 * nr.rand(10, 5)).astype(int)), # 2D
ta.array(nr.rand(10, 5)),
ta.array(nr.rand(10, 5) + 1j * nr.rand(10, 5)),
ta.array((100 * nr.rand(10, 5, 3)).astype(int)), # 3D
ta.array(nr.rand(10, 5, 3)),
ta.array(nr.rand(10, 5, 3) + 1j * nr.rand(10, 5, 3))]
results = [pickle.loads(pickle.dumps(t)) for t in tests]
[assert_equal(t, r) for t, r in zip(tests, results)]
for dtype in dtypes:
for shape in some_shapes:
a = ta.array(make(shape, dtype))
assert_equal(pickle.loads(pickle.dumps(a)), a)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment