MCPcopy Create free account
hub / github.com/numpy/numpy / test_pickle

Method test_pickle

numpy/_core/tests/test_multiarray.py:2008–2015  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2006 assert_equal(zs, pickle.loads(zs.dumps()))
2007
2008 def test_pickle(self):
2009 for proto in range(2, pickle.HIGHEST_PROTOCOL + 1):
2010 for dt in [bytes, np.void, str]:
2011 zs = self._zeros(10, dt)
2012 p = pickle.dumps(zs, protocol=proto)
2013 zs2 = pickle.loads(p)
2014
2015 assert_equal(zs.dtype, zs2.dtype)
2016
2017 def test_pickle_empty(self):
2018 """Checking if an empty array pickled and un-pickled will not cause a

Callers

nothing calls this directly

Calls 2

_zerosMethod · 0.95
assert_equalFunction · 0.90

Tested by

no test coverage detected